debrouwere / python-ballpark

Better human-readable numbers
ISC License
40 stars 14 forks source link

rounding in between orders of magnitude #9

Open debrouwere opened 6 years ago

debrouwere commented 6 years ago

Quantize to somewhere in between a magnitude.

For example:

Note that quantization beyond an order of magnitude results in a variable amount of decimal digits depending on the lowest common multiple.

For example:

debrouwere commented 6 years ago

This kind of quantization is often useful when producing charts: when the maximum value is 117K, the axis should preferably go from 0 to 120K or 0 to 125K instead.

Should support round, ceil, floor, min and max.