closure-library icon indicating copy to clipboard operation
closure-library copied to clipboard

Add support for cldr RBNF

Open ribrdb opened this issue 5 years ago • 2 comments

It would be great if goog.i18n supported rules based number formatting for spelling out numbers.

ribrdb avatar Jul 22 '20 05:07 ribrdb

To clarify, you mean a hypothetical

goog.i18n.formatAsNumbers(500); // "Five hundred" in English, or "quinientos" in Spanish

I think this would be a use-case best supported by the Intl NumberFormat API (though it doesn't support it now as far as I can tell).

12wrigja avatar Jul 22 '20 17:07 12wrigja

Something like that. An analogue of the ICU RuleBasedNumberFormatter. I posted it here mainly because CLDR has data for doing this type of formatting, and they list Closure Library as one of the frameworks you should use to access CLDR data.

ribrdb avatar Jul 22 '20 21:07 ribrdb