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
This commit is contained in:
Miran 2019-11-05 10:31:23 +01:00 • committed by Andreas Rumpf
commit ffa9a7405f
4 changed files with 39 additions and 28 deletions

View file

@ -692,12 +692,11 @@ when isMainModule:
check &"{-123.456:.3f}", "-123.456"
check &"{123.456:1g}", "123.456"
check &"{123.456:.1f}", "123.5"
check &"{123.456:.0f}", "123."
#check &"{123.456:.0f}", "123."
check &"{123.456:.0f}", "123"
check &"{123.456:>9.3f}", " 123.456"
check &"{123.456:9.3f}", " 123.456"
check &"{123.456:>9.4f}", " 123.4560"
check &"{123.456:>9.0f}", " 123."
check &"{123.456:>9.0f}", " 123"
check &"{123.456:<9.4f}", "123.4560 "
# Float (scientific) tests