1 SQL> SELECT
 2   2    TO_CHAR(123,  '9990.00') A,
 3   3    TO_CHAR(5.8,  '9990.00') B,
 4   4    TO_CHAR(.46,  '9990.00') C
 5   5  FROM
 6   6    dual;
 7 
 8 A                B                C
 9 ---------------- ---------------- ----------------
10   123.00             5.80             0.46
11 
12 SQL>
‘9990.00’表示转换的数字的最大数,可根据自身表里面的number字段大小,进行调整。
比如number(19,2)可变成 :
ltrim(to_char(price,'9999999999999999999.00'))
但,如果price的值为0的话,就会转成.00,所以用下面的方法再decode一下就可以了。
decode(price,0,'0.00',ltrim(to_char(price,'9999999999999999999.00')))

相关文章:

  • 2021-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-23
  • 2022-02-10
  • 2021-09-04
猜你喜欢
  • 2021-09-20
  • 2022-12-23
  • 2022-12-23
  • 2021-12-20
  • 2022-02-27
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案