2.1.6.15 DoubleToStr


Description

Convert a double value into a string using LabTalk formating notation

Syntax

void DoubleToStr( double dbVal, LPSTR lpszOutput, int nOutputSize, LPCTSTR lpcszFormat )

Parameters

dbVal
[input] value to convert
lpszOutput
[output] buffer to receive the output
nOutputSize
[input] size of the buffer
lpcszFormat
[input] LabTalk formatting string, "*", or "*5*" etc

Return

None

Examples

EX1

// This is a self contained sample program for the function DoubleToStr, 
// To run the program, enter the following command in the Script window:
//   DoubleToStr_ex1
// If it runs successfully, the following meassage will be printed:
//   Pi is 3.14 for only 3 significant digits.
//
void    DoubleToStr_ex1()
{

    char szTemp[30];
    DoubleToStr(Pi, szTemp, 30, "*3");
    printf("  Pi is %s for only 3 significant digits\n", szTemp);
}

Remark

Similar to LabTalk $(x) notation, convert a double value into a string using LabTalk formating notation

See Also

Header to Include

origin.h

Reference