Why does Javascript's Intl.NumberFormat API use 21 as the max value for `maximumSignificantDigits`?

Viewed 152

In the Javascript NumberFormat API, there is a maximumSignificantDigits option, which is not allowed to exceed 21.

My question is: why 21?

This limit seems especially odd to me given that, as I understand it, all Numbers in JS are 64 bit floats, which can only encode up to 17 significant decimal digits.

0 Answers
Related