summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorMiran <narimiran@disroot.org>2019-11-05 10:31:23 +0100
committerAndreas Rumpf <rumpf_a@web.de>2019-11-05 10:31:23 +0100
commitffa9a7405fe55f91d3816d3cf4b3b1b82ede21ff (patch)
treedc8528c1649942e5dac964a6d2d0ba30e1ebcac7 /tests
parent46af8164c0a71fc154afa2bd528d7a1f9d1cd6eb (diff)
downloadNim-ffa9a7405fe55f91d3816d3cf4b3b1b82ede21ff.tar.gz
fix #8242, fix #12586: fix 'formatFloat' with 'precision = 0' (#12592)
* 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
Diffstat (limited to 'tests')
-rw-r--r--tests/destructor/tnewruntime_strutils.nim3
1 files changed, 1 insertions, 2 deletions
diff --git a/tests/destructor/tnewruntime_strutils.nim b/tests/destructor/tnewruntime_strutils.nim
index c77177f58..dd190a1b6 100644
--- a/tests/destructor/tnewruntime_strutils.nim
+++ b/tests/destructor/tnewruntime_strutils.nim
@@ -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