IsEqualMoney

public static partial class ExtensionMethods
{
    public static bool IsEqualMoney(this decimal money1, decimal money2)
    {
        return Math.Abs(money1 - money2) <= 0.01M;
    }
}
Example:
if (faktuur.ReedsBetaaldInc.IsEqualMoney
       (faktuur.BedragTotaalInc))
   return new SolidColorBrush(Colors.Green);
        else
   return new SolidColorBrush(Colors.Red);

Description

Compares two money (decimal) variables ignoring differences above 0.01. Useful for comparing two calculated decimals. 73,414.IsEqualMoney(73,41) returns true.

Details

Double click on the code to select all.

 

;