圆形函数问题 [英] round function problem
本文介绍了圆形函数问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个从上个月开始运作良好的程序.但现在在一种情况下,舍入功能无法对数字进行舍入,如下所示:
声明@per float;
选择@ per = 1.39
选择回合((((11250 + 0)* @ per),0)
它给出了15637而不是15638
15637.5 = 15638
sqlserver
i have a procedure that working fine from last five month. but now in one case the round function cannot round the figure see below:
declare @per float;
select @per=1.39
select round(((11250+0)*@per),0)
it giveing 15637 instead of 15638
15637.5= 15638
sqlserver
推荐答案
嗨
将其转换为十进制
Hi
convert it to decimal
declare @per float;
select @per=1.39
select CONVERT(decimal(18,3),round(((11250+0)*convert(decimal(18,3),@per)),0))
问候
三举
Regards
Sanju
这篇关于圆形函数问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文