Skip to main content

Convert-to-Decimal-Data

Command Description

Convert data to decimal (float) type

Command Prototype

dRet = CNumber(varData)

Parameter Description

ParameterRequiredTypeDefaultDescription
varDataTrueexpression$PrevResultData to be converted

return

dRet,The variable used to save the output of the command.

Demo

TracePrint("---------------------------------Convert to decimal data--------- ----------------------------") 
//-------------------------------------------------------------------------------
//[Remarks] Convert the data to a decimal (floating point number)
//Input parameter 1:
// varData----->target data
//out parameters:
// Converted decimal data
TracePrint("Convert string '1.5' to decimal")
TracePrint("The data type before conversion is: "&Type("1.5"))
dRet = CNumber ("1.5")
TracePrint("The converted data type is: "&type(dRet))