Choose where you’d like to start

toDecimal

Overview

The toDecimal function takes an expression as an argument, and returns a decimal value.;

Return Type

  • DECIMAL

Syntax

<variable> = <expression>.toDecimal();

(OR)

<variable> = toDecimal(<expression>);

where,

ParameterData typeDescription
<variable>DECIMALVariable which will contain the converted decimal value.
<expression>DECIMAL/NUMBER/TEXT

The expression which will be returned in decimal format.

Empty texts will throw an error during runtime.

Text should contain only numerical values.

Examples

 marks = 99.9 ;
 marks_text = "100" ;

 info toDecimal(marks); // Returns 99.9
 info toDecimal(marks_text); // Returns 100

Get Started Now

Execute