ecma402
ecma402 copied to clipboard
Support cash rounding
See https://github.com/tc39/ecma402/issues/134
CLDR has both normal (financial) rounding and cash rounding for currencies. We should consider adding an option to Intl.NumberFormat to support cash rounding.
Sample API:
new Intl.NumberFormat(undefined, { style: "currency", currencyRounding: "cash" })
Should the option be named:
- currencyRounding
- currencyPrecision
- currencyUse
I've put up PR #839 for this as an item for discussion. The PR uses currencyPrecision for the name of the option. currencyRounding seems bad (even though it's the most straightforward seeming) since it implies that only the rounding increment changes. currencyUse appears as valid as currencyPrecision, though.
TG2 discussion: https://github.com/tc39/ecma402/blob/master/meetings/notes-2024-01-18.md#support-cash-rounding-835
Conclusion: Add Test262 and docs for the current spec behavior.