Interface IAmount
Non-generic root for any typed monetary or physical quantity.
Precision is the scale of the value's fractional part;
implementations that represent a scale-free quantity (e.g. a whole
count) use 0.
public interface IAmount
Remarks
Ordering across differing precisions is not meaningful and must be rejected by implementations (see PrecisionMismatchException). C# has no dependent types, so this invariant is enforced at runtime.
Properties
IsZero
true when this amount equals the additive identity.
bool IsZero { get; }
Property Value
Precision
Number of fractional digits carried by this amount.
int Precision { get; }
Property Value
Methods
CompareTo(IAmount)
Compare with another amount. Implementations reject differing scales (base/precision) at runtime via PrecisionMismatchException.
int CompareTo(IAmount other)
Parameters
otherIAmountAmount to compare against.