Class Name

atg.commerce.pricing.CurrencyCodeDroplet

Component(s)

/atg/commerce/pricing/CurrencyCodeDroplet

The CurrencyCodeDroplet servlet bean takes a locale as input and returns the currency code for that locale.

Input Parameters

locale (Required)
The current locale.

Output Parameter

currencyCode
The ISO 4217 currency code for the locale.

Open Parameters

output
The open parameter is always rendered.

Example

The following example shows the JSP code for the CurrencyCodeDroplet servlet bean. In the example, the locale is retrieved from the user’s profile and used to format the amount of a gift certificate.

<dsp:droplet name="CurrencyCodeDroplet">
  <dsp:param name="locale" bean="Profile.PriceList.locale"/>
  <dsp:oparam name="output">
    <dsp:getvalueof var="currencyCode" vartype="java.lang.String"
param="currencyCode"/>
    <dsp:getvalueof var="amount" vartype="java.lang.Double"
param="giftCertificate.amount"/>
  </dsp:oparam>
</dsp:droplet>
<%-- The format of message to display is:
A gift certificate has been purchased for you in the amount of {0} by {1} {2} --%>
<fmt:message key="emailtemplates_giftCertificate.purchasedInfo">
  <fmt:param>
    <fmt:formatNumber value="${amount}" type="currency"
currencyCode="${currencyCode}"/>
  </fmt:param>
….
 
loading table of contents...