User Tools

Site Tools


syntax:functions:asnumber

This is an old revision of the document!


AsNumber(value)

This function converts the value to number. This is useful when you wish to validate the contents of a field or retrieve the number value of a field.

  • 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.
Example Result
asnumber( 0 - 13 ) -13
asnumber( 1 > 2 ) 0
asnumber( 'text' ) #Can't convert to number

See also

syntax/functions/asnumber.1429412647.txt.gz · Last modified: 2015/04/18 23:04 by dmitry

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki