Currency formats in a multicurrency implementation
When PolicyCenter is in multicurrency mode, monetary amounts can be in different currencies. PolicyCenter uses the currency.xml file corresponding to the relevant currency to format monetary amounts. If there is no currency.xml file corresponding to the chosen region, PolicyCenter uses the settings specified in the ICU Library. The currency.xml files can be accessed in Guidewire Studio from Project window to .
In the base configuration, the is one currency.xml file for each of the defined currencies. Each file is stored in a folder whose name is the currency code:
AUD– Australian dollarCAD– Canadian dollarEUR– European Union euroGBP– British poundJPY– Japanese yenRUB– Russian rubleUSD– U.S. dollar
In general, PolicyCenter shows currency data using the settings specified by the ICU Library. However, if you want use a different set of currency formats, you can override the ICU Library settings.
Currency scale overrides
Your instance may need a different number of digits stored in the database and shown in the
user interface depending on the currency. To set currency-specific storage values, use the
storageScale attribute on the <CurrencyType>
element in file currency.xml.
The <CurrencyType> attributes that you can override include:
storageScale– The number of decimal digits to store in the database for this currency. For example, United States dollars have two digits after the decimal point indicating the number of cents. Therefore the storage scale forusdis"2".
For example, in the base configuration:
File currency.xml for the Australian dollar defines the following
storageScale:<CurrencyType code="aud" desc="Australian Dollar" storageScale="2">File currency.xml for the Japanese yen defines the following
storageScale:<CurrencyType code="jpy" desc="Japanese Yen" storageScale="0">
Currency format overrides
The <CurrencyFormat> attributes that you can override include:
negativePattern- How PolicyCenter displays negative monetary amounts. PolicyCenter displays and formats the numeric value in place of the pound sign (#) in the pattern. PolicyCenter displays all other characters in the pattern as listed without modification.- For example, the negative pattern ($#) displays the numeric value -32 as ($32.00).
positivePattern- How PolicyCenter displays positive monetary amounts. PolicyCenter displays and formats the numeric value in place of the pound sign (#) in the pattern. PolicyCenter displays all other characters in the pattern as listed without modification.- For example, the positive pattern $# displays the numeric value 32 as $32.00.
zeroValue- How PolicyCenter displays zero amounts. For example, the zero value patttern can be 0 (zero) or - (dash). If the numeric value of a monetary amount is null, PolicyCenter displays the amount as empty or blank. The monetary amount must be a non-null 0.00 amount for the zero value pattern to be used.- For example, the zeroValue - displays the numeric value 0 as -.
For example, the currency.xml file for US Dollars defines the following:
<?xml version="1.0" encoding="UTF-8"?>
<Currency xmlns="http://guidewire.com/currency">
<CurrencyType code="usd" desc="US Dollar" storageScale="2">
<CurrencyFormat zeroValue="-"/>
</CurrencyType>
</Currency>
There is a currency format override for the zero value (so that zero values are shown as "-"). There are no overrides for the negative pattern and positive pattern.
Create currency format overrides in a multicurrency implementation
About this task
Procedure
- In Guidewire Studio™, navigate to .
- Right-click currencies and select . This creates a new directory in the currencies folder. Name the directory after the lowercase version of the three-letter ISO 4217 currency code. For example, nzd.
- Right-click the package created in the previous step and select . Name the file currency.xml.
- Open one of the existing currency.xml files for one of the other currencies. Copy the contents of this file into the new file.
- Modify the XML to match the new currency and to specify the desired currency format overrides.
