Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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..
Posted
Comments
Dinesh.V.Kumar 11-Feb-14 2:13am    
Try quantity -= Math.Ceil(txtQty.Text)


Regards

1 solution

you can use Math.Ceiling(rcpQty)
description and examples here
http://msdn.microsoft.com/en-us/library/zx4t0t48(v=vs.110).aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900