Localized price display
Last updated on
30 April 2025
Currency 2 displays prices/amounts based on users' locales, so they are formatted in a way that is familiar to them. The different formats can be configured at Home » Administration » Configuration » Regional and language » Currency localization. Locales consist of a language and a country, and formatting patterns are configured per locale. Currency tries the following combinations to find a formatting pattern:
- The country code set using
CurrencyLocalePattern::setCountryCode()and the current page language. - The site's default country (configured at Home » Administration » Configuration » Regional and language » Regional settings) and the current page language.
- English and the United States of America.
This means that if you want to use your own country detection mechanism, your module will have to call CurrencyLocalePattern::setCountryCode() every single page request.
Help improve this page
Page status: Not set
You can:
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion