日期:2014-05-16 浏览次数:20667 次
体重:<ww:text name='format.num.3'><ww:param value='person.weight'/></ww:text>(Km)
select t.num from( select ltrim(rtrim(to_char(0.44, '99990.000'), '0') , ' ') as num from dual union select ltrim(rtrim(to_char(0.441, '99990.000'), '0'), ' ') as num from dual union select ltrim(rtrim(to_char(1.0, '99990.0'), '0'), ' ') as num from dual union select ltrim(rtrim(to_char(10.100, '99990.000'), '0'), ' ') as num from dual )t /* 结果: 0.44 0.441 1. 10.1 */
select (case when instr(t.num,'.')=length(t.num) then rtrim(t.num,'.') else t.num end) as num from( select ltrim(rtrim(to_char(0.44, '99990.000'), '0') , ' ') as num from dual union select ltrim(rtrim(to_char(0.441, '99990.000'), '0'), ' ') as num from dual union select ltrim(rtrim(to_char(1.0, '99990.0'), '0'), ' ') as num from dual union select ltrim(rtrim(to_char(10.100, '99990.000'), '0'), ' ') as num from dual )t /* 结果: 0.44 0.441 1 10.1 */