$(a: float) now works consistently in nim js, avoiding printing floats as ints (#14134)

* fix https://github.com/timotheecour/Nim/issues/133; $(a: float) works in nim js like in other backends

* fix tests

* fix test for windows that prints 1.1e17 differently than other OS
This commit is contained in:
Timothee Cour 2020-04-27 08:33:03 -07:00 • committed by GitHub
commit bb982c644b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 90 additions and 11 deletions

View file

@ -1,15 +1,16 @@
discard """
output: '''foo 12
output: '''
foo 12
bar 12
2
foo 12
bar 12
2
12.5
(nums: @[5, 5, 10, 5, 5, 5, 5, 5, 5, 5])
(nums: @[5, 5, 50, 5, 5, 5, 5, 5, 5, 5])
(nums: @[5, 5, 45, 5, 5, 5, 5, 5, 5, 5])
(nums: @[5, 5, 9, 5, 5, 5, 5, 5, 5, 5])
(nums: @[5.0, 5.0, 10.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0])
(nums: @[5.0, 5.0, 50.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0])
(nums: @[5.0, 5.0, 45.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0])
(nums: @[5.0, 5.0, 9.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0])
asd
'''
"""