Oracle to_char 转换数值

时间:2021-10-24 15:47:20
SQL> Select CONCAT(TO_CHAR('0.001'*100,'990.99'),'%') FROM DUAL;

CONCAT(TO_CHAR('
----------------
0.10%

SQL> select to_char(1234567.89,'9,999,999.99') id from dual;

ID
--------------------------
1,234,567.89

SQL> select to_char(1234567.89,'999,999,999.99') id from dual;

ID
------------------------------
1,234,567.89

SQL> select to_char(1234567.89,'009,999,999.9900') id from dual;

ID
----------------------------------
001,234,567.8900

SQL> select to_char(1234567.89,'9.99EEEE') id from dual;

ID
--------------------
1.23E+06

SQL> select to_char(1234567.89,'999999.99EEEE') id from dual;

ID
--------------------
1.23E+06



SQL> select to_char(-1234567.89,'999,999,999.99PR') id from dual;

ID
--------------------------------
<1,234,567.89>