Mono Class Library: System.Decimal Overview | Members

System.Decimal.Subtract Method

Subtracts one decimal value from another.

public static decimal Subtract (decimal d1, decimal d2)

Parameters

d1
The left-side operand.
d2
The right-side operand.

Returns

A decimal containing the result of subtracting d2 from d1 . 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 -1.12, and 2.50 - 1 gives 1.50.

Exceptions

TypeReason
OverflowExceptionThe result is greater than decimal.MaxValue or less than decimal.MinValue.

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