MO Class
An MO is a quantity expressing the amount of money in some currency

Inheritance Hierarchy

OnlineSystem Object
  MARC.Everest.DataTypes HXIT
    MARC.Everest.DataTypes ANY
      MARC.Everest.DataTypes PDV <OnlineNullable <OnlineDecimal > >
        MARC.Everest.DataTypes QTY <OnlineNullable <OnlineDecimal > >
          MARC.Everest.DataTypes MO

Namespace: MARC.Everest.DataTypes
Assembly: MARC.Everest.Phone (in MARC.Everest.Phone.dll) Version: 1.5.0.0 (1.5.0)

Syntax

C#

public class MO : QTY<Nullable<decimal>>, 
	IEquatable<MO>, IComparable<MO>, IRealValue, 
	IPrimitiveDataValue, IAny, IImplementsNullFlavor, ISemanticEquatable, IGraphable

Remarks

The monetary amount class in Everest 1.0 contains methods that allow for arithmetic operations to be performed against instances for example:

Examples

Change Problem

Console.Write("Enter an Amount:$");
MO amount = new MO(decimal.Parse(Console.ReadLine()), "CAD");
MO loonies = new MO((int)(amount / 1), "CAD");
amount -= loonies;
MO quarters = new MO((decimal)(0.25 * (int)(amount / 0.25)), "CAD");
amount -= quarters;
MO dimes = new MO((decimal)(0.10 * (int)(amount / 0.10)), "CAD");
amount -= dimes;
MO nickels = new MO((decimal)(0.05 * (int)(amount / 0.05)), "CAD");
amount -= nickels;
Console.WriteLine("Total Change:\r\n{0} in loonies\r\n{1} in quarters\r\n{2} in dimes\r\n{3} in nickels\r\n{4} in pennies",
    loonies, quarters, dimes, nickels, amount);

Version Information

Everest Compact Framework

Supported in: 1.2 Compact

Everest Framework

Supported in: 1.2, 1.0

See Also