-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
The addTrailingZeros method in abstract-number-format-input is redundant and overrides default and expected behaviors already provided by the formatter. If a user wanted trailing zeros, then they can set the minimumSignificantDigits option. Intl.NumberFormat will truncate zeros when the number of fractional digits is less than maximumFractionDigits and this component should honor that behavior.
var number = 123.456;
formatter = new Intl.NumberFormat("en-US", { style: 'decimal', minimumSignificantDigits: 20 });
console.log(formatter.format(number))
// "123.45600000000000000"
formatter = new Intl.NumberFormat("en-US", { style: 'decimal', maximumFractionDigits: 20 });
console.log(formatter.format(number))
// "123.456"Metadata
Metadata
Assignees
Labels
No labels