-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve formatCurrency short form symbol formatting with exceptinos (#…
- Loading branch information
Showing
4 changed files
with
125 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
'@shopify/react-i18n': minor | ||
--- | ||
|
||
Update currency symbol formatting to follow Polaris localized currency formatting guidelines. No longer displays a character or ISO code beside the currency symbol, for certain currencies and locales. The following table summarizes the changes, assuming a locale of `en-US`: | ||
|
||
| Method | Previous output | New output | | ||
| ------------------------------------------------------------- | -------------------------------- | ------------------------------- | | ||
| `i18n.formatCurrency(2, {currency: 'AUD', form: 'short'})` | `A$2.00` | `$2.00` | | ||
| `i18n.formatCurrency(2, {currency: 'AUD', form: 'explicit'})` | `A$2.00 AUD` | `$2.00 AUD` | | ||
| `i18n.formatCurrency(2, {currency: 'AUD', form: 'auto'})` | `A$2.00 AUD` | `$2.00 AUD` | | ||
| `i18n.formatCurrency(2, {currency: 'SGD', form: 'explicit'})` | `SGD 2.00 SGD` | `$2.00 SGD` | | ||
| `i18n.getCurrencySymbol('AUD')` | `{symbol: 'A$', prefixed: true}` | `{symbol: '$', prefixed: true}` | | ||
|
||
Deprecate usage of`i18n.getCurrencySymbolLocalized(locale, currency)`. Use `i18n.getCurrencySymbol(currency, locale)` instead. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters