mgnslndh/NCicode — Issue #4: Converting numbers to strings with string format operator
Author: mgnslndh
Created: 2011-11-22 19:07:16+00:00
State: open

In Cicode it is possible to convert integers and real variables to strings using a string format operator:

>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.)