globalizejs / globalize

A JavaScript library for internationalization and localization that leverages the official Unicode CLDR JSON data
https://globalizejs.com
MIT License
4.8k stars 603 forks source link

Number format to parts #680

Closed rxaviers closed 4 years ago

rxaviers commented 7 years ago

Context

Formatter is designed to provide an opaque string as an output that is not meant to be manipulated by the consumer, which makes impossible for UX/design using rich formatting, e.g., "1 000.<strong>35</strong>" and "35.4 <strong>%</strong>".

Goal

Expose format to parts similarly to Ecma-402 Intl.DateTimeFormat.prototype.formatToParts().

References