php mysql decimal 多余的0 解决方案

php mysql decimal 多余的0 解决方案

 

select id,(0+cast(price as decimal(10,2))) as price,title from goods where id=1 

2 就是最多的保留小数位数