首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

oracle 封存小数值

2012-09-22 
oracle 保留小数值保留2位小数 , 不够补0 :select to_char(123456789.9,999999999.00) from dual 结果:?

oracle 保留小数值

保留2位小数 , 不够补0 :

select to_char(123456789.9,'999999999.00') from dual

结果:

?123456789.90

?

select to_char(123456789.1234,rpad('999999999.',11,'0'))? from dual

结果:

?123456789.12

?

select round(1234.45,1) from dual

结果:

1234.5

(round会四舍五入)

?

select round(1234.45,3) from dual

结果:

1234.45

?

select trunc(1234.45678,3) from dual

结果:

1234.456

(trunc直接截断,不会四舍无入)

热点排行
Bad Request.