Community
Participate
Working Groups
program formatSmallFloat type BasicProgram {} mySmallFloat smallFloat; myString string; function main() mySmallFloat = 2.345678; myString = stringLib.format(mySmallFloat, "***.**********"); SysLib.writeStdout("Should be **2.3456780000 > " + myString); end end myString should be **2.3456780000 instead, it's **2.3456780910
The number formatter method in the runtime only supports bigdecimal and so the smallfloat is being converted to a bigdecimal, causing an imprecise value. The runtime needs to have additional logic for floating point numbers. My belief is that this is not a P1 level item, so reducing it to P3. If you disagree, then we can discuss.
fixed
Verified in 20111114 build.