Convert-to-Decimal
Command Description
By default, only 28 integers and decimals can be saved, and the exceeding part will be removed
Command Prototype
deRet = Decimal(varData)
Parameter Description
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
varData | True | expression | $PrevResult | The data to convert into a base-10 decimal number |
return
deRet,The variable used to save the output of the command.
Demo
TracePrint("---------------------------------Convert to decimal number--------- ----------------------------")
//-------------------------------------------------------------------------------
//[Remarks] Convert integers, floating-point numbers or strings to decimal numbers, save 28 integers and decimals by default, and truncate at 28 if the number exceeds 28.
//Input parameter 1:
// varData----->Data to be converted
//out parameters:
// deRet--Assign the result of running the command to this variable.
TracePrint("Convert string 12 to decimal number")
varData="12"
deRet = Decimal ($ PrevResult)
TracePrint("The converted result is: ")
TracePrint(deRet)