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