C# Decimal Equals(Decimal)
Description
Decimal Equals(Decimal)
returns a value indicating
whether this instance and a specified Decimal object represent the same
value.
Syntax
Decimal.Equals(Decimal)
has the following syntax.
public bool Equals(
decimal value
)
Parameters
Decimal.Equals(Decimal)
has the following parameters.
value
- An object to compare to this instance.
Returns
Decimal.Equals(Decimal)
method returns true if value is equal to this instance; otherwise, false.
Example
The following code shows how to use Decimal.Equals(Decimal)
method.
using System;/*from w w w .j a v a 2 s . c om*/
class DecimalMulDivRemDemo
{
public static void Main( )
{
decimal d = 1000M;
Console.WriteLine(d.Equals(7M) );
}
}
The code above generates the following result.