My advice: stop using double first . If you need decimal rounding, then the odds are good, you should use decimal . What is your app?
If you have a double, you can do it like this:
double r = whatever; decimal d = (decimal)r; decimal truncated = decimal.Truncate(d * 100m) / 100m;
Note that this method will not work if the absolute double value is greater than 792281625142643375935439504, because multiplication by 100 will fail. If you need to handle large values, you will need to use special methods. (Of course, by the time the double is so large, you are still superior to its ability to represent values โโwith two digits after the decimal point).
Eric Lippert
source share