C# Decimal Decrement
Description
Decimal Decrement
decrements the Decimal operand by one.
Syntax
Decimal.Decrement
has the following syntax.
public static decimal operator --(
decimal d
)
Parameters
Decimal.Decrement
has the following parameters.
d
- The value to decrement.
Returns
Decimal.Decrement
method returns The value of d decremented by 1.
Example
The Addition method defines the operation of the addition operator for Decimal values. It enables code such as the following:
using System;// ww w .j a v a 2 s.c om
public class Example
{
public static void Main()
{
Decimal number = 1079.8m;
Console.WriteLine("Original value: {0:N}", number);
Console.WriteLine("Decremented value: {0:N}", --number);
}
}
The code above generates the following result.