Fix regression in naturalsize for float#240
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #240 +/- ##
=======================================
Coverage 99.49% 99.49%
=======================================
Files 11 11
Lines 796 796
=======================================
Hits 792 792
Misses 4 4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Hi @hugovk That's actually wonderful. I can accept either behaviour, but I wanted it to be stable. Your additional tests really help with that. Ironically the change in behaviour popped up because my tests spotted it. My local fix was also to convert the bytes to an integer. I do have cases where I'm looking at the average-bytes-per-second so it might not be an integer. However, The proposed fix does an
which is tolerable, but not what I'd expect from So, in summary, I'd be fine with it going in this way. I really appreciate you getting to this so quickly. |
|
Yeah, and it matches the behaviour of the earlier percent formatting: >>> "%d" % 2.7
'2'
>>> int(2.7)
2I'm open to changing the rounding, but let's do it in a more intentional way than a bad formatting upgrade :) |
|
Nice, thanks @hugovk |
|
You're welcome! 🚀 |
Fixes #239.