Breadcrumbs

convertToFloat() Operation for Strings


Syntax


set aFloat = aString.convertToFloat()
set aFloat = convertToFloat(LITERAL)


Semantics

Converts the lexical representation of a float (e.g. 1.2345) to a Float type. The float string is considered until a non-numeric character is found (digits, signs, E and e are considered valid numeric characters for this parameter as specified in the format). The format used is: [white spaces][+|-][nnnnn][.nnnnn][e|E[+|-]nnnn]
White spaces are any tab or space character. nnnnn may be any number of digits.

If the conversion is not possible, an error message is raised (for instance: NULL strings).

Substitutables

aString

Can be any variable or object attribute having the type String.  

LITERAL

String literal.

Examples


set aFloat = aString.convertToFloat();

For a UML example, refer to

Type Converter Operations

.