Correct way to precisely round decimals in C#

Viewed 36

This is my code:

    decimal test1 = 190.5m;
    decimal test2 = 191.5m;
    var testResult1 = Math.Round(test1, 0); // =190 It should be 191!!!!
    var testResult2 = Math.Round(test2, 0); // =192 Correct.

Is there a way I could get the correct result? Maybe another library instead of System.Math?

1 Answers
Related