Since we have Math.floor, Math.round, and Math.ceil for three types of rounding, why can't we specify them when using Number.prototype.toFixed:
For example:
(1.02).toFixed(1); // => "1.0"
(1.05).toFixed(1); // => "1.1" round by default
// If we can specify types:
(1.05).toFixed(1, FLOOR); // => "1.0"
(1.02).toFixed(1, CEIL); // => "1.1"
sffc
2
It's not exactly for Number.prototype.toFixed, but here's a discussion about this issue for Intl.NumberFormat:
2 Likes