Export (0) Print
Expand All

Decimal.MaxValue Field

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

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

public static readonly decimal MaxValue
public static final Decimal MaxValue
public static final var MaxValue : decimal
Not applicable.

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 decimal Capacity {
        get {
            return Decimal.MaxValue;
        }
    }

    protected decimal MyFortune;

    public void AddPenny() {
        MyFortune += .01m;
    }
}

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 Server 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 Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0

XNA Framework

Supported in: 1.0

Community Additions

ADD
Show:
© 2014 Microsoft