Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to Round up Some values to a With out Decimal places. but i want it as this :

Ex if Doubel Val = 3.2 then i need to round up this Value as a 4.0 Not as 3.0. Can anyone have a Solution on this matter.
Math.Round(Val, MidpointRounding.AwayFromZero);
But it does not bring the Right Solution!!!
Posted

1 solution

Hi,

val = System.Math.Ceiling(val);

Have a nice day
 
Share this answer
 
v3
Comments
SoMad 14-Jun-12 6:18am    
You beat me to it :)
Val = Math.Ceiling(Val);

Soren Madsen
Roman Lerman 14-Jun-12 6:35am    
Ok, more so I will not :)
Hesha 14-Jun-12 7:02am    
Thanks a Lot Roman!!!
Umer Aziz Malik 14-Jun-12 8:01am    
Nice prompt answer :) +5

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