* fix #8242, fix #12586: fix 'formatFloat' with 'precision = 0' 'formatFloat' with 'precision = 0' now gives the same result (a number without a decimal point) in all backends. This is compatible with Python's formatters, too. * fix failing tests * add changelog entry * add version switch
This commit is contained in:
parent
46af8164c0
commit
ffa9a7405f
4 changed files with 39 additions and 28 deletions
|
|
@ -14,8 +14,7 @@ proc retTuple(): (seq[int], int) =
|
|||
|
||||
proc nonStaticTests =
|
||||
doAssert formatBiggestFloat(1234.567, ffDecimal, -1) == "1234.567000"
|
||||
when not defined(js):
|
||||
doAssert formatBiggestFloat(1234.567, ffDecimal, 0) == "1235." # <=== bug 8242
|
||||
doAssert formatBiggestFloat(1234.567, ffDecimal, 0) == "1235" # bugs 8242, 12586
|
||||
doAssert formatBiggestFloat(1234.567, ffDecimal, 1) == "1234.6"
|
||||
doAssert formatBiggestFloat(0.00000000001, ffDecimal, 11) == "0.00000000001"
|
||||
doAssert formatBiggestFloat(0.00000000001, ffScientific, 1, ',') in
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue