C# Decimal Negate
Description
Decimal Negate
returns the result of multiplying the
specified Decimal value by negative one.
Syntax
Decimal.Negate
has the following syntax.
public static decimal Negate(
decimal d
)
Parameters
Decimal.Negate
has the following parameters.
d
- The value to negate.
Returns
Decimal.Negate
method returns A decimal number with the value of d, but the opposite sign. -or- Zero, if d
is zero.
Example
Example of the decimal.Negate method.
/*from w w w. j a v a 2 s. c om*/
using System;
class MainClass{
public static void Main( )
{
Console.WriteLine( decimal.Negate( -123.456M ) );
}
}
The code above generates the following result.