Silverlight - round doubles away from zero

Posted by Cornel on Stack Overflow See other posts from Stack Overflow or by Cornel
Published on 2010-05-31T09:19:29Z Indexed on 2010/05/31 9:22 UTC
Read the original article Hit count: 214

Filed under:
|

In Silverlight the Math.Round() method does not contain an overload with 'MidpointRounding' parameter. What is the best approach to round a double away from zero in Silverlight in this case?

Example:

Math.Round(1.4) => 1

Math.Round(1.5) => 2

Math.Round(1.6) => 2

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about math