$tonumber
Welcome to our Knowledge Base
Documentation | Blog | Demos | Support
< All Topics
Print
$tonumber
0 out of 5 stars
5 Stars | 0% | |
4 Stars | 0% | |
3 Stars | 0% | |
2 Stars | 0% | |
1 Stars | 0% |
Converts a value into its numeric equivalent.
Syntax
$tonumber(expression,decimals)
Parameters
expression | Any value, or an expression that yields any value. |
decimals | A number specifying the number of decimal places required in the converted value. Decimals can be negative. |
Return Value
Number equivalent of expression.
Comments
Use $tonumber to obtain the numeric equivalent of expression. If decimals is negative, the implicit number of decimal places in expression is used.
Example
$tonumber(1.273,2)
Evaluates to 1.27.
$tonumber(16/6,3)
Evaluates to 2.667.
$tonumber("2345",2)
Evaluates to 2345.00.
$tonumber("Smith",5)
Evaluates to 0.00000 (and produces an error).
$tonumber("1.2"*1.20,-1)
Evaluates to 1.44.
See Also
$money
$round
$toalpha
$tocharacter
About Functional Expressions
Decimals and Rounding
Decimals in Functional Expressions
Number Literals
Updated
ByJason Lee
Was this article helpful?
0 out of 5 stars
5 Stars | 0% | |
4 Stars | 0% | |
3 Stars | 0% | |
2 Stars | 0% | |
1 Stars | 0% |
5