Product:    ISaGRAF 4.0x
Date: 29-January-2001
File: Real to String.htm
Subject: How to convert a Real to a String
Keywords: String - Real - conversion


The ANY_TO_STRING conversion does not work with inputs of type REAL.

To work-around that you can

develop a C function and add it to the virtual machine if your system supports this conversion


Use the following IEC function.

Parameters are as follows:


Type Direction


REAL Input


STRING(255) Output

StringToReal := any_to_string(any_to_dint(RealValue *100000.0)/100000) + '.' + any_to_string(mod(any_to_dint(abs(RealValue *100000.0)), 100000));


Copyright © 1999-2009 ICS Triplex ISaGRAF Inc. All rights reserved.