Cicode Programming Reference > Converting and Formatting Cicode Variables > Converting Real Numbers to Strings

Converting Real Numbers to Strings

To convert a real number variable to a string:

RealVar=5.2;
StringVar=RealVar;

The value of StringVar is set to "5.2".

Note: Unpredictable results may occur if you use large numbers with a large number of decimal places.

The format of the string is specified when the variable is defined in the database. However you can override this default format with the string format (:) operator, and use the # format specifier to set a new format. For example:

StrTag1=RealTag1:######.###

The value of StringVar = " 5.200". (The '#' formatting characters determine the size and number of decimal places contained in the string, that is a length of 10 including a decimal point and three decimal places.)

See Also

Converting and Formatting Cicode Variables

Using Cicode Files