Functions.Str3 方法 |
命名空间: XSharp.RT
FUNCTION Str3( fNumber AS FLOAT, dwLength AS DWORD, dwDecimals AS DWORD ) AS STRING
public static string Str3( __Float fNumber, uint dwLength, uint dwDecimals )
1LOCAL fNumber AS FLOAT 2fNumber := 123.45 3? Str3(fNumber, 10, 1) // 123.5 4? Str3(fNumber * 10, 7, 2) // 1234.50 5? Str3(fNumber * 10, 12, 4) // 1234.5000
1? Str(9,6,6) => "******" 2? Str(9,6,5) => "******" 3? Str(9,6,4) => "9.0000" 4? Str(9,6,3) => " 9.000" 5? Str(10,6,6) => "******" 6? Str(10,6,5) => "******" 7? Str(10,6,4) => "******" 8? Str(10,6,3) => "10.000"