Home Oracle 保留三位小数,不足补0
Post
Cancel

Oracle 保留三位小数,不足补0

格式化为小数

1
2
3
4
select 
  to_char(round(0.2, 3),'fm99999999990.000')
from 
  dual;

格式化为百分比

1
2
3
4
select
  to_char(round(0.2*100,2),'fm99999999990.00')||'%'
from 
  dual;
This post is licensed under CC BY 4.0 by the author.