select 50.00 qty, trim(trailing '0' from 50.00) qty0, to_char(50.00, 'FM9999.999') qty1, trim(trailing '.' from to_char(50.00, 'FM9999.999')) qty2, rtrim(to_char(50.00,'fm9990.99'),'.') qty3 from dual
select 50.10 qty, trim(trailing '0' from 50.10) qty0, to_char(50.10, 'FM9999.999') qty1, trim(trailing '.' from to_char(50.10, 'FM9999.999')) qty2, rtrim(to_char(50.10,'fm9990.99'),'.') qty3 from dual
所以,
trim(trailing '.' from to_char(50.00, 'FM9999.999')) qty2,
rtrim(to_char(50.00,'fm9990.99'),'.') qty3
这两种方式才是正确的。
标签:trim,trailing,char,Oracle,去掉,FM9999.999,50.10,50.00,小数 From: https://www.cnblogs.com/lgx5/p/18174660