Table of Contents

Interface IAsCardinal<TCardinal>

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

Bridges between an IAmount<TValue> and a single canonical integer representation. Used to implement arithmetic on amounts whose parts live in different fields (whole vs. fractional).

public interface IAsCardinal<TCardinal> where TCardinal : struct

Type Parameters

TCardinal

Canonical integer representation.

Methods

FromCardinal(TCardinal)

Recover the original amount components from a cardinal value.

(long Whole, ulong Fraction) FromCardinal(TCardinal cardinal)

Parameters

cardinal TCardinal

Cardinal value to convert.

Returns

(long Whole, ulong Fraction)

ToCardinal()

Convert to the canonical integer representation.

TCardinal ToCardinal()

Returns

TCardinal