EsbDecimals - a Free Subset of ESBPCS for .NET

CompareOps.CompareValue Method (Decimal, Decimal)

Returns 0 if Values are within a "small" value computed from the supplied precision, 1 if the first value is greater than Y and -1 if the first value is lesser. DecimalPrecisionDef defines the precision.

If you just want to know whether two values are the same then use SameValue

[Visual Basic]
Overloads Public Shared Function CompareValue( _
   ByVal x As Decimal, _
   ByVal y As Decimal _
) As Integer
[C#]
public static int CompareValue(
   decimal x,
   decimal y
);

Parameters

x
First Value to Compare.
y
Second Value to Compare.

Return Value

0 (Same), 1 (First Value Greater) or -1 (Second Value Greater).

Remarks

There is an overloaded version that allows you to specifiy the precision of the comparison.

See Also

CompareOps Class | Esb.Math Namespace | CompareOps.CompareValue Overload List