todecimal()

Learn how to use the todecimal() function to convert the input expression to a decimal number representation.

Converts the input to a decimal number representation.

Syntax

todecimal(value)

Parameters

NameTypeRequiredDescription
valuescalar✔️The value to convert to a decimal.

Returns

If conversion is successful, result is a decimal number. If conversion isn’t successful, result is null.

Example

The following example checks if the result of converting the input "123.45678" is equal to the decimal 123.45678.

print todecimal("123.45678") == decimal(123.45678)

Output

print_0
true