Mono Class Library: System.Decimal Overview | Members

System.Decimal.Add Method

Adds two decimal values together.

public static decimal Add (decimal d1, decimal d2)

Parameters

d1
The first addend.
d2
The second addend.

Returns

A decimal containing the sum of d1 and d2. The scale of the result, before any rounding, is the larger of the scales of d1 and d2. For example, 1.1 + 2.22 gives 3.32, and 2.50 + 1 gives 3.50.

Exceptions

TypeReason
OverflowExceptionThe sum of d1 and d2 is less than decimal.MinValue or greater than decimal.MaxValue.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0