如何用小数点检查数字 [英] How to check number with decimal points

查看:120
本文介绍了如何用小数点检查数字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好



我有一个变量double rcpQty



现在我正在进入的应用程序数量为1.500甚至5.000



所以现在我想做的是,如果有一个点后的值,那么它将从库存中扣除qty = 1,如果之后的值点数全是0然后它将从库存中扣除整数部分即5。



请告诉我如何执行此操作..

Hi all

I have one variable double rcpQty

now in the application i am entering Qty as 1.500 and even 5.000

so now i want to do is if there is a value after point then it will deduct qty=1 from stock and if the value after point is all 0's then it will deduct the integer part i.e 5 from stock.

Please tell me how to do this..

推荐答案

你可以使用 Math.Ceiling(rcpQty)

这里的描述和例子

http://msdn.microsoft.com/en-us/library/zx4t0t48 (v = vs.110).aspx [ ^ ]


这篇关于如何用小数点检查数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆