webdesserts / alchemist-js

The extensible color library
https://webdesserts.gitbooks.io/alchemist-js/
MIT License
11 stars 2 forks source link

toPrecision rounding quirks #24

Open webdesserts opened 9 years ago

webdesserts commented 9 years ago

Rounding is currently not working as I originally expected. When dealing with larger floats that happen to be simple enough, toPrecision will store them in scientific notation.

0.0000000001.toPrecision(4) //=>1.000e-10

I need to decide if this is expected behavior or not and if not, how to solve it.