Add currency sign £, $ to specific ORACLE fields

I want to show a dollar or pound sign in my fields that contain job_salary, which anyone knows? as

+3
source share
2 answers

Using the $dollar sign in hardcodes mask format (after all, Oracle is an American corporation). Other currencies are determined by the setting for NLS_TERRITORY. Use Cto see the abbreviation of the ISO currency (UKP) and Lfor the symbol (£).

SQL> select to_char(sal, 'C999,999.00') as ISO
  2         , to_char(sal, 'L999,999.00') as symbol from emp
  3  /

ISO                SYMBOL
------------------ ---------------------
       GBP3,500.00             £3,500.00
       GBP3,750.00             £3,750.00 

...
+3
source

My preference:

select to_char(123456789.91, 'FM$999,999,999,990.00')
  from dual;

Create a format string up to as many digits as you need. FM skips the master space to account for negative number alignment.

to_char ((123456789.91, 'FM999,999,999,990.00C') ;

, ISO

+1

Source: https://habr.com/ru/post/1742896/


All Articles