Compares two Currency values and returns an integer that indicates the result of the comparison.
[Visual Basic] Public Shared Function Compare( _ ByVal c1 As Currency, _ ByVal c2 As Currency _ ) As Integer [C#] public static int Compare( Currency c1, Currency c2 ); [C++] public: static int Compare( Currency c1, Currency c2 ); [JScript] public static function Compare( c1 : Currency, c2 : Currency ) : int;
Value Type | Condition |
---|---|
1 | If the first Currecny value is greater than the second Currency value . |
0 | If the two Currency values are equal. |
-1 | If the first Currency value is less than the second Currency value. |
The Compare method evaluates and determines the relationship of two Currency values, returning an integer that indicates the result of that evaluation.
The values are determined using the following equations:
1 if c1 > c2, 0 if c1 = c2, or-1 if c1 < c2.
Currency c1 =...
Currency c2 = ...
If (Currency.Compare (c1, c2) > 0) Console.WriteLine ("c1 > c2"); If (Curency.Compare (c1, c2) == 0) Console.WriteLine ("c1 == c2"); If (Curency.Compare (c1, c2) < 0) Console.WriteLine ("c1 < c2");