ext/intl: Add NumberFormatter::CURRENCY_ISO
, PLURAL
, STANDARD
and CASH_CURRENCY
#18007
+228
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ICU 54 and 56 adds the following formatters1 for currency formatting:
CURRENCY_ISO
2: ISO currency code, e.g., "USD1.00"CURRENCY_PLURAL
3: pluralized currency name, e.g., "1.00 US dollar" and "3.00 US dollars"CASH_CURRENCY
4: currency symbol given CASH usage, e.g., "NT$3" instead of "NT$3.23"CURRENCY_STANDARD
5: currency symbol, e.g., "$1.00", using non-accounting style for negative values (e.g. minus sign)Ref: https://unicode-org.github.io/icu-docs/apidoc/dev/icu4c/unum_8h.html
This adds support for all four of them to ext/intl, along with tests.
Footnotes
https://unicode-org.github.io/icu-docs/apidoc/dev/icu4c/unum_8h.html ↩
https://unicode-org.github.io/icu-docs/apidoc/dev/icu4c/unum_8h.html#a4eb4d3ff13bd506e7078b2be4052266daae232c48e579c727525855cd21571033 ↩
https://unicode-org.github.io/icu-docs/apidoc/dev/icu4c/unum_8h.html#a4eb4d3ff13bd506e7078b2be4052266da3916bb92d0784396ea2331d4f04c03f5 ↩
https://unicode-org.github.io/icu-docs/apidoc/dev/icu4c/unum_8h.html#a4eb4d3ff13bd506e7078b2be4052266da8da9eba1a27d5734599709c137c3b82f ↩
https://unicode-org.github.io/icu-docs/apidoc/dev/icu4c/unum_8h.html#a4eb4d3ff13bd506e7078b2be4052266dac57cfff1b245d11774e8b109b98eedc2 ↩