Commit fec14ca
committed
fix(filesize): don't parse formatted mantissa back to float
naturalsize()'s unit rollover check ran the user-supplied format string
through float(), which raises ValueError whenever that format contains
text around the numeric conversion (e.g. "Size: %.1f"), a regression
from 4.15.0.
Compare the rendered mantissa against the rendered base instead, so the
carry-over still works and arbitrary formats are accepted again.
Closes #3661 parent 42b4a1d commit fec14ca
2 files changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
107 | 109 | | |
108 | 110 | | |
109 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
94 | 98 | | |
95 | 99 | | |
96 | 100 | | |
| |||
0 commit comments