## Definition

``````public:
static System::Decimal Add(System::Decimal d1, System::Decimal d2);``````
``public static decimal Add (decimal d1, decimal d2);``
``static member Add : decimal * decimal -> decimal``
``Public Shared Function Add (d1 As Decimal, d2 As Decimal) As Decimal``

#### Parameter

d1
Decimal Decimal Decimal Decimal

d2
Decimal Decimal Decimal Decimal

#### Gibt zurück

Die Summe von `d1` und `d2`.The sum of `d1` and `d2`.

#### Ausnahmen

Die Summe von `d1` und `d2` ist kleiner als MinValue oder größer als MaxValue.The sum of `d1` and `d2` is less than MinValue or greater than MaxValue.

## Hinweise

Im folgenden Codebeispiel wird die Verwendung von `Add` veranschaulicht:The following code sample illustrates the use of `Add` :

``````   public ref class PiggyBank
{
public:
{
MyFortune = Decimal::Add( MyFortune, (Decimal).01 );
}

virtual System::String^ ToString() override
{
return MyFortune.ToString("C")+" in piggy bank";
}

protected:
Decimal MyFortune;
};
}
``````
``````class PiggyBank {
}

public override string ToString() {
return MyFortune.ToString("C")+" in piggy bank";
}

protected decimal MyFortune;
}
``````
``````Class PiggyBank