13
Aug
在Mysql运算中四舍五入
今天在写客户返利系统,需要用到这方面的运算。
1.四舍五入 round(123.5)
2.舍去小数 floor(123.5)
3.如果小数部分有值就进一 ceil(123.5) 或者 ceiling(123.5)
示例
select round((select howmuch from fanli_userinfo where username='admin') * 192.7);
By admin|脚本编程|Be the first to comment!
今天在写客户返利系统,需要用到这方面的运算。
1.四舍五入 round(123.5)
2.舍去小数 floor(123.5)
3.如果小数部分有值就进一 ceil(123.5) 或者 ceiling(123.5)
示例
select round((select howmuch from fanli_userinfo where username='admin') * 192.7);
0 Comments