Returns only the numbers in text, as field type number.
GetAsNumber ( text )
text
- any text expression or text field containing numbers
number
FileMaker Pro 6.0 or earlier
Use with formulas involving numbers or numeric functions. This function drops from text
all non-numeric characters, leading zeros, and trailing zeros after the decimal point. GetAsNumber returns a negative number if the first numbers in text
are preceded by a minus sign "-" or are inside parentheses "( )," unless a period or a number precedes the minus sign or left parenthesis. If zero numeric characters are in text
, GetAsNumber returns an empty string.
You can also use this function to convert a date to the number of days. The returned number is the number of days since 1/1/0001.
GetAsNumber ( "FY20" )
returns 20.
GetAsNumber ( "$1,254.50" )
returns 1254.5.
GetAsNumber ( "2 - 2" )
and GetAsNumber ( "2(2)" )
return 22.
GetAsNumber ( "-22" )
and GetAsNumber ( "(22)" )
return -22.
GetAsNumber ( ".(22)" )
returns .22.
GetAsNumber ( SerialNumber )
returns 35684, when the value of SerialNumber is TKV35FRG6HH84.
GetAsNumber ( DateOfBirth )
returns 737342, when the DateOfBirth field contains 10/10/2019.
GetAsNumber ( Passcode )
returns an empty string, when the Passcode field contains QTjPLeRMaCV.