NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Decimal.Compare

Compares specified Decimal values.

[Visual Basic]
Public Shared Function Compare( _
   ByVal d1 As Decimal, _
   ByVal d2 As Decimal _
) As Integer
[C#]
public static int Compare(
   Decimal d1,
   Decimal d2
);
[C++]
public: static int Compare(
   Decimal d1,
   Decimal d2
);
[JScript]
public static function Compare(
   d1 : Decimal,
   d2 : Decimal
) : int;

Parameters

d1
The left operand, a Decimal.
d2
The right operand, a Decimal.

Return Value

Value Description
-1 If the first number is less than the second number.
0 If the numbers are equal.
1 If the first number is greater than the second number.

Remarks

The Compare method compares two decimal values and returns an integer that represents the relationship between the values.

For example: if the first value is less than the second, then a negative one is returned. If the first value is equal the second, then a zero is returned. If the first value is more than the second, then a one is returned. The relationship can be expressed by the following:

-1 if d1 < d2,

0 if d1 = d2, or

1 if d1 > d2.

See Also

Decimal Structure | Decimal Members | System Namespace