On This Page

Home / Search/ Language Reference/ Functions/ Scalar Functions/ Conversion Functions/toreal

toreal ​

The toreal function converts the input to a value of type real (double, decimal).

Aliases: real, decimal, todecimal, double, todouble.

Syntax ​

toreal( Expression )

Arguments ​

  • Expression: Expression whose value will be converted to a value of type real.

Returns ​

If the type conversion is successful, returns a value of type real (double, decimal).

If the type conversion fails, returns null.

Example ​

  • toreal("123.4") returns 123.4
  • toreal("1e3") returns 1000
  • toreal("hello") returns null