webdesserts / alchemist-js

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

toPrecision vs. toFixed #12

Open webdesserts opened 9 years ago

webdesserts commented 9 years ago

So all along I've been using the term "precision" and I didn't know that there was actually a toPrecision() function that does something completely different to toFixed().

var num = 10.23456
num.toFixed(3) // 10.235
num.toPrecision(3) // 10.2

It might be good to provide an option for both of these. Either way, I should reassess the default.