Mathematical operations, Math.ceil property | SoloLearn: Learn to code for FREE!


Mathematical operations, Math.ceil property

Since I want an output of 14.45, I have p=14.445, If i use Output=Math.Round(p,2) ; I get the output of 14.44, I couldn't able to use math.ceiling here because it consists of two arguments, Is there is any way of getting output of 14.45?

5/31/2020 1:08:13 AM


8 Answers

New Answer


Use this as a 3rd argument with Math.Round: MidpointRounding.AwayFromZero You can read more about it here:


This might also be helpful to review.


Thank you coffeeunderrun David Carroll and fork() 😇🤗 it helps


coffeeunderrun nope, he is referring Math.floor as above example he provided before


Round accepts a third argument: Math.Round(p, 2, MidpointRounding.AwayFromZero)


fork() are you are referring to using the Midpoint Rounding with Round? I just verified that I get 1.04, using your example of 1.0352, when using AwayFromZero. Unless I misunderstood what you were saying.


Thank you for the clarification, Ashraf!


coffeeunderrun thank you bro, could you please elaborate? I couldn't understand that