syntax:functions:asnumber
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
syntax:functions:asnumber [2015/01/29 22:23] – created dmitry | syntax:functions:asnumber [2021/09/12 12:13] (current) – craigt | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== AsNumber(value) ===== | + | ====== AsNumber(expression) ====== |
+ | Category: | ||
- | Converts the //value// to number. | + | \\ |
+ | =====Description===== | ||
+ | This function converts | ||
- | Text should have only digits and one decimal point. | + | \\ |
+ | =====Use cases===== | ||
+ | This is useful when you wish to validate the contents of a field or retrieve the number value of a field. | ||
- | Boolean | + | \\ |
+ | =====Arguments===== | ||
+ | ^Argument^Type^Description^ | ||
+ | |expression|Number, | ||
- | Number remains itself. | + | **Return value type:** Number |
+ | |||
+ | \\ | ||
+ | =====Remarks===== | ||
+ | * Text should have only digits and one decimal point. | ||
+ | * Boolean is converted into -1 (TRUE) or 0 (FALSE). | ||
+ | * Number remains itself. | ||
+ | * Everything else returns error. | ||
+ | |||
+ | \\ | ||
+ | =====Examples===== | ||
+ | asnumber( ' | ||
+ | |||
+ | asnumber( 543.21 ) //Returns 543.21 | ||
+ | |||
+ | asnumber( 1 > 2 ) //Returns 0 (FALSE result of an expression.) | ||
+ | |||
+ | asnumber( ' | ||
+ | |||
+ | \\ | ||
+ | =====See also===== | ||
+ | * [[syntax: | ||
- | Everything else returns error. |
syntax/functions/asnumber.txt · Last modified: 2021/09/12 12:13 by craigt