The JavaScript exception "precision is out of range" occurs when a number that's outside of the range of 0 and 20 (or 21) was passed into toFixed
or toPrecision
.
The JavaScript exception "precision is out of range" occurs when a number that's outside of the range of 0 and 20 (or 21) was passed into toFixed
or toPrecision
.
There was an out of range precision argument in one of these methods:
Number.prototype.toExponential()
, which requires the arguments to be between 0 and 100, inclusive.Number.prototype.toFixed()
, which requires the arguments to be between 0 and 100, inclusive.Number.prototype.toPrecision()
, which requires the arguments to be between 1 and 100, inclusive.
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Precision_range