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 initonly 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 :

   public ref class PiggyBank
   {
   public:
      Decimal Capacity()
      {
         return MyFortune.MaxValue;
      }

      void AddPenny()
      {
         MyFortune = Decimal::Add(MyFortune, (Decimal).01);
      }

   protected:
      Decimal MyFortune;
   };

}

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

Community Additions

ADD
Show:
© 2014 Microsoft