Message407905
Well, it makes sense for negative zero produced by rounding.
But if we add a special support for this case, it would be useful to have some control on the type of rounding. Currently floats are rounded to the nearest decimal number, but in some cases it would be better to round up, down, toward zero or infinity (seed for example issue44884).
You can round explicitly before formatting, but this solution is also applicable for this issue:
>>> '%5.1f' % (round(-.00001, 1) + 0.0)
' 0.0' |
|
Date |
User |
Action |
Args |
2021-12-07 09:54:42 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, mark.dickinson, eric.smith, steven.daprano, John Belmonte |
2021-12-07 09:54:42 | serhiy.storchaka | set | messageid: <1638870882.74.0.271280110061.issue45995@roundup.psfhosted.org> |
2021-12-07 09:54:42 | serhiy.storchaka | link | issue45995 messages |
2021-12-07 09:54:42 | serhiy.storchaka | create | |
|