if you are using SQL Server, try ROUND function, for exampleselect ROUND(748.58, 0)
==>
749.00
==>
749.00
解决方案 »
- 输出存储过程问题
- 求助
- 网页图片显示问题
- 怎样在Web.config里设置try-catch出错后访问的错误页
- 请问在哪能下载AspNetPager的使用方法,要带运行程序的
- 框架页面读取父页面的参数值,有无可能?
- 用JS怎么控制窗体的位置来让他移动起来,
- 怎么判断取到的一个值全是数字呢?
- 我用Graphics做曲线图 图片保存时 文件名怎么没有后缀gif或jpg?
- .net 是什么东西,大家说说,让我入入门,:)
- 为什么会这样,会SQL的帮帮忙.?!
- 在<title ...>中加入了runat=server,但每次在改过页面后,.net都会自动把runat=..给去掉,真是烦死了,怎样才能禁止自动改呀
返回数字表达式并四舍五入为指定的长度或精度。语法
ROUND ( numeric_expression , length [ , function ] ) 参数
numeric_expression精确数字或近似数字数据类型类别的表达式(bit 数据类型除外)。length是 numeric_expression 将要四舍五入的精度。length 必须是 tinyint、smallint 或int。当 length 为正数时,numeric_expression 四舍五入为 length 所指定的小数位数。当 length 为负数时,numeric_expression 则按 length 所指定的在小数点的左边四舍五入。function是要执行的操作类型。function 必须是 tinyint、smallint 或 int。如果省略 function 或 function 的值为 0(默认),numeric_expression 将四舍五入。当指定 0 以外的值时,将截断 numeric_expression。
set @i=2.25
set @j=2.75select floor(@i+0.5)select floor(@j+0.5)go
select round(@i,0)select round(@j,0)go