Skip to main content

System.Math calls the provided numeric type's rounding method

https://referencesource.microsoft.com/#mscorlib/system/math.cs

When I was at a prior position, we needed to be able to round decimal values in a variety of cases. If we want to round a numeric type, we use that type's rounding methods to perform the operation.

However, this is a purely cosmetic code choice in an attempt to be explicit about what kind of operation is occurring. 

Most of the calls to rounding methods in the Math class will use the rounding method implemented by the provided numeric type's class. Example, providing a decimal type to Math.Round will call the Decimal class's Round method.