User Tools

Site Tools


syntax:functions:asnumber

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
syntax:functions:asnumber [2015/04/18 23:05] dmitrysyntax:functions:asnumber [2021/09/12 12:13] (current) craigt
Line 1: Line 1:
-===== AsNumber(value) =====+====== AsNumber(expression) =====
 +Category:  Special function
  
-This function converts the //value// to number. This is useful when you wish to validate the contents of field or retrieve the number value of a field.+\\  
 +=====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, Text, Boolean|The value or result of an expression to be converted into a number value.|
 +
 +**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  ^  Result +\\  
-asnumber( '123.45' )  |  123.45  +=====Examples===== 
-asnumber( 543.21 )  |  543.21  | +  asnumber( '123.45' )  //Returns 123.45 
-| asnumber( 1 > 2 )  |  0  | + 
-| asnumber( 'text' )  |  #Can't convert to number  |+  asnumber( 543.21 )  //Returns 543.21
  
 +  asnumber( 1 > 2 )  //Returns 0  (FALSE result of an expression.)
  
 +  asnumber( 'text' )  //Returns '#Can't convert to number'
  
 +\\ 
 +=====See also=====
 +  * [[syntax:functions:astext|AsText(expression)]]
  
-=== See also === 
-  * [[syntax:functions:astext| AsText(value)]] 
syntax/functions/asnumber.1429412713.txt.gz · Last modified: 2015/04/18 23:05 by dmitry

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki