Error AtlasError Documentation and Resolution

JavaScript number formatting precision is out of range

RangeError: precision is out of range

JavaScript rejected a numeric formatting call because the requested precision is outside the supported range.

RangeError: precision is out of rangeruntime
RangeError: precision is out of range
  • A number formatting method received a precision outside the supported range.
  • User input was passed directly into a precision argument.
  • Conversion or parsing logic produced an unexpected formatting value.
  1. Clamp or validate precision values before calling number formatting methods.
  2. Check the accepted range for the specific formatting API.
  3. Treat user-supplied formatting options as untrusted input.
MDN: RangeError: precision is out of range
JavaScript precision is out of range: causes and fixes | Error Atlas