StrD()
语法
Result$ = StrD(Value.d [, NbDecimal])概要
Converts a double number into a string.
参数
Value.d The value to convert. NbDecimal (optional) The maximum number of decimal places for the converted number. If omitted, it will be set to 10 decimal places, with removing the trailing zeros. The number will be rounded, if 'NbDecimal' is smaller than existing decimal places of 'Value.d'.
返回值
A string holding the converted value.
Remarks
Signed integer numbers have to be converted with Str() and unsigned numbers with StrU(). It is possible to omit this command when concatenating string and double, it will then use the default behaviour of StrD().
示例
Value.d = 10.54 Debug "Result: " + StrD(Value) ; we do not use the 2nd parameter, so we get a float number rounded to 10 decimal places Debug "Result: " + Value ; same as previous line Debug "Result: " + StrD(Value, 2) ; we want a result with two decimal places, no rounding needed as we have only two Debug "Result: " + StrD(Value, 0) ; we want a result with no decimal places, so the value is rounded
参阅
StrF(), Str(), StrU()
已支持操作系统
所有