0只有这样才会起作用
不取作用
SQL> select to_char(890, '$9G999D99') from dual;
TO_CHAR(890,'$9G999D99')
--------------------------------------------------------------------------------
$890.00
取作用
SQL> select to_char(890, '$0G999D99') from dual;
TO_CHAR(890,'$0G999D99')
--------------------------------------------------------------------------------
$0,890.00
至于它的小数位数,是9还是0都会取作用
SQL> select to_char(1890, '$0G999D99') from dual;
TO_CHAR(1890,'$0G999D99')
--------------------------------------------------------------------------------
$1,890.00
SQL> select to_char(1890, '$0G999D00') from dual;
TO_CHAR(1890,'$0G999D00')
--------------------------------------------------------------------------------
$1,890.00
其它的你再试试就知道了...
把1890.55 转换成 $1890.55,如何表达
SQL> select to_char(1890.55, '$9G999D99') from dual;
TO_CHAR(1890.55,'$9G999D99')
--------------------------------------------------------------------------------
$1,890.55
这样就可以...
下面再说几个典型的例子
SQL> select to_char(0.55, '$999G999G999G990D99') from dual;
TO_CHAR(.55,'$999G999G999G990D
--------------------------------------------------------------------------------
$0.55
SQL> select to_char(0.55, '$999G999G999G999D99') from dual;
TO_CHAR(.55,'$999G999G999G999D
--------------------------------------------------------------------------------
$.55
楼主明白否,0只有再前面才有效果....