doubleToStr (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

ALL

Firmware version:

3.10 / 1.00.00


This function converts a DOUBLE to a string.

 

Note: This function works with DOUBLE, but can also work with FLOAT as described in the Floating-point math introductory section.

 

Input:

v : DOUBLE

Value to convert.

 

Returns: STRING

A string representation the value of v with 16 significant digits.

 

Declaration:

FUNCTION doubleToStr : STRING;
VAR_INPUT
v : DOUBLE;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
INCLUDE math.inc
 
PROGRAM test;
 
DebugMsg(message := " sin(270) = " + doubleToStr(v := sin(v := degToRad(v := 270.0))));
DebugMsg(message := " asin(1) = " + doubleToStr(v := radToDeg(v := asin(v := 1.0))));
 
END_PROGRAM;