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.
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 totoFixed()
.It might be good to provide an option for both of these. Either way, I should reassess the default.