2 Day Developer > Working in a Global Environ... > Setting Up the Globalizatio... > Monetary Parameters
Monetary Parameters |
Previous |
Next |
Oracle Database XE enables you to define radix symbols and thousands separators by locales. For example, in the US, the decimal point is a period (.), while it is a comma (,) in France. Because $1,234 has different meanings in different countries, it is important to display the amount appropriately by locale.
This section contains the following topics:
Different currency formats are used throughout the world. Some typical formats are shown in Table: Currency Format Examples.
The NLS_CURRENCY
parameter specifies the character string returned by the L
number format model, the local currency symbol. Setting NLS_CURRENCY
overrides the default setting defined implicitly by NLS_TERRITORY
. The value can be any valid currency symbol string, as shown in Example: Displaying the Local Currency Symbol.
Displaying the Local Currency Symbol
-- select and format the salary column from employees SELECT TO_CHAR(salary, 'L099G999D99') "salary" FROM employees WHERE salary > 11000;
The output from the example should be similar to the following:
SALARY
---------------------
$024,000.00
$017,000.00
$017,000.00
$012,000.00
$014,000.00
$013,500.00
$012,000.00
$011,500.00
$013,000.00
$012,000.00
The NLS_ISO_CURRENCY
parameter specifies the character string returned by the C
number format model, the ISO currency symbol. Setting NLS_ISO_CURRENCY
overrides the default value defined implicitly by NLS_TERRITORY
. The value can be any valid string.
Local currency symbols can be ambiguous. For example, a dollar sign ($) can refer to U.S. dollars or Australian dollars. ISO specifications define unique currency symbols for specific territories or countries. For example, the ISO currency symbol for the U.S. dollar is USD. The ISO currency symbol for the Australian dollar is AUD.
The NLS_ISO_CURRENCY
parameter has the same syntax as the NLS_TERRITORY
parameter, and all supported territories are valid values.
To specify the ISO currency symbol for France, set NLS_ISO_CURRENCY
as shown in Example: Setting NLS_ISO_CURRENCY=FRANCE.
Setting NLS_ISO_CURRENCY=FRANCE
-- set NLS_ISO_CURRENCY to France ALTER SESSION SET NLS_ISO_CURRENCY = FRANCE; -- display the salary of selected employees SELECT TO_CHAR(salary, 'C099G999D99') "Salary" FROM employees WHERE department_id = 60;
The output from the example should be similar to the following:
Salary
--------------------
EUR009,000.00
EUR006,000.00
EUR004,800.00
EUR004,800.00
EUR004,200.00