PolymerElements / app-localize-behavior

Polymer behaviour to help internationalize your application
48 stars 54 forks source link

Fix tests on older chrome, which returns different values for `Intl.NumberFormat#format` with currency. #134

Closed bicknellr closed 6 years ago

bicknellr commented 6 years ago

Chrome 41 requires minimumFractionDigits:

formatter = new Intl.NumberFormat('fr-FR', {
  style: 'currency',
  currency: 'USD',
});
formatter.format(10); // returns "10 $US"

formatter = new Intl.NumberFormat('fr-FR', {
  style: 'currency',
  currency: 'USD',
  minimumFractionDigits: 2,
});
formatter.format(10); // returns "10,00 $US"