Decimal.MaxValue Field

Represents the largest possible value of Decimal. This field is constant and read-only.

Namespace: System
Assembly: mscorlib (in mscorlib.dll)

'Declaration
Public Shared ReadOnly MaxValue As Decimal
'Usage
Dim value As Decimal

value = Decimal.MaxValue

public static final Decimal MaxValue
public static final var MaxValue : decimal

The value of this constant is positive 79,228,162,514,264,337,593,543,950,335.

The following code sample illustrates the use of MaxValue :

Class PiggyBank
    Public ReadOnly Property Capacity() As Decimal
        Get
            Return [Decimal].MaxValue
        End Get
    End Property

    Protected MyFortune As Decimal

    Public Sub AddPenny()
        MyFortune += 0.01D
    End Sub
End Class

class PiggyBank
{
    /** @property 
     */
    public System.Decimal get_Capacity()
    {
        return System.Decimal.MaxValue;
    } //get_Capacity

    protected System.Decimal myFortune;

    public void AddPenny()
    {
        myFortune.Add(myFortune, System.Convert.ToDecimal(0.01));
    } //AddPenny
} //PiggyBank

class PiggyBank {
    public function get Capacity() : Decimal {
            return Decimal.MaxValue;
    }

    protected var MyFortune : Decimal;

    public function AddPenny() {
        MyFortune = Decimal.Add(MyFortune, 0.01);
    }
}

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0
Show: