valdezt / sigfig

A python module aimed to aid the user with visual display of scientific numbers, i.e. significant figures, rounding, spacing, etc.
12 stars 4 forks source link

Add example showing how it handles rounding big integers #3

Open nealmcb opened 3 years ago

nealmcb commented 3 years ago

E.g. is round(123456, 4) == 123500 or 123500.0 or something else?

I think the latter (a common result in various other approaches as noted on stackoverflow) is wrong since adding a decimal point is commonly interpreted as extending the precision.

(I know I could install it myself and find out, but others will want to know also, and I don't see it offhand in the docs.) Thanks!

MikeBusuttil commented 3 years ago

agreed @nealmcb ! the result in this package the former, not the latter. I'll review that stackoverflow post and consider adding it to the docs