This function enables you to convert a text to a number. The text will be read from the left to the right. As soon as the function comes upon a character that is not a 0,1,2,3,4,5,6,7,8, or 9 it will stop the conversion and return to what it has converted so far. This function makes it possible to turn a TEXT into a NUMBER. This is useful if, for instance, the database values retrieved are TEXT where NUMBERS are needed.
text_to_number ( text_to_be_converted )
The result of this function is of type NUMBER: the inputted text converted to a number.
This function has one parameter:
Which decimal symbol and digit-grouping symbol are used depends on your ITP Output Language setting.
Example
This example uses the ENG ITP Output Language.
@( text_to_number( "1239aa" ) )
Result: 1,239.00
@( text_to_number( "1a239" ) )
Result: 1.00. *
Note that the construction @ ( ) around the function means that the result of the function is displayed in the text. This construction must be used in a text part of a model document. The switch from ITP mode to text mode in a model document is made with the # characters. An ITP model document starts in text model, the #BEGIN makes the switch to ITP mode.