Navigation: Function Reference > General Utility Functions > val()

val()

Top  Previous  Next

val( numberString : String; var numberVar : Number Type; var errorCode: Integer );

 

Converts a string into both integer and floating point type variables. The variable numberVar must be of the appropriate type when compared with numberString. If the conversion succeeds then errorCode will return 0, otherwise errorCode will be set to the first character in numberString that failed the conversion.

 

Parameters

 

numberString

number formatted as a string

numberVar

integer or floating point value

errorCode

integer value

 

var

       numberString: String;

       numberValue: Double;

       error: Integer;

 

       numberString := '125564.30402';

 

       val( numberString, numberValue, error );