Intl currency formatting and minimum significant digits

Zach Lym zachlym at indolering.com
Sat Oct 22 04:52:59 UTC 2016


I recently ran into a discrepancy between Chrome and Firefox's
implementation of Intl's currency formatting mechanism and the
official spec.  I didn't want the output to have any significant
digits so I used the following:

    new Intl.NumberFormat('en-US', {maximumSignificantDigits: 0,
currency: 'USD', style: 'currency', currencyDisplay: "symbol"});

This works fine on Chrome and Firefox but the polyfill threw an error
and the standard appears to require at least one significant digit.

I strongly believe the spec should be changed to remove the
requirement that the output contain any significant digits.

Thank you,
-Zach Lym


More information about the es-discuss mailing list