C# Decimal UnaryPlus

Description

Decimal UnaryPlus returns the value of the Decimal operand (the sign of the operand is unchanged).

Syntax

Decimal.UnaryPlus has the following syntax.


public static decimal operator +(
  decimal d
)

Parameters

Decimal.UnaryPlus has the following parameters.

  • d - The operand to return.

Returns

Decimal.UnaryPlus method returns The value of the operand, d.

Example


/*ww w.java  2  s .c o  m*/
using System;

public class Example
{
   public static void Main()
   {
      Decimal number1 = 120.07m;
      Decimal number2 = +163.19m;
      Decimal number3 = number1 - number2;
      Console.WriteLine(number3);
   }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version