Localized price display
You are browsing documentation for an older version of Drupal, which is not supported any longer, and the information may not be correct. See current documentation for Contributed modules
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
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