Table of Contents

Interface IAmount

Namespace
Virtufin.Core.Position
Assembly
Virtufin.Core.dll

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

bool

Precision

Number of fractional digits carried by this amount.

int Precision { get; }

Property Value

int

Methods

CompareTo(IAmount)

Compare with another amount. Implementations reject differing scales (base/precision) at runtime via PrecisionMismatchException.

int CompareTo(IAmount other)

Parameters

other IAmount

Amount to compare against.

Returns

int