Displays a numeric value as a currency amount, and converts a value from one currency to another, formatting it based on the locale.
Class Name |
|
---|---|
Component |
|
Required Input Parameters
currency
The number to convert and format.
targetLocale
The currency’s conversion locale. This conversion uses exchangeRates
property in the CurrencyConversionTagConverter
and the locale.
Optional Input Parameters
locale
The currency’s source locale. For example, if sourceLocale
is en_US
then currency is expressed in US dollars. This value can be either a java.util.Locale
object or a String that represents a locale. In order to use euro currency, the variant of the locale must be EURO. If this parameter is not provided, the default locale is used.
euroSymbol
Used if the target locale is using euro currency. If provided, this parameter is used as the euro symbol. This is useful because the commonly-used character set ISO Latin-1 (ISO 8859-1) does not include the euro character.
Output Parameters
formattedCurrency
The formatted currency.
Open Parameters
output
The oparam
that is always rendered.
Usage Notes
CurrencyConversionFormatter
can be used to convert and format a numeric amount. The amount can be converted from one currency to another.
Example
<dsp:droplet name="/atg/dynamo/droplet/CurrencyConversionFormatter"> <dsp:param param="price.listPrice" name="currency"/> <dsp:param value="en_US" name="locale"/> <dsp:param value="de_DE_EURO" name="targetLocale"/> <dsp:param value="€" name="euroSymbol"/> <dsp:oparam name="output"> <dsp:valueof valueishtml="true" param="formattedCurrency">no price</dsp:valueof> </dsp:oparam> </dsp:droplet>