Table of Contents

Struct DecimalQuantity<U>

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

A DecimalAmount paired with an IUnit. Formats as "{Amount} {Unit}".

public readonly record struct DecimalQuantity<U> : IQuantity<DecimalAmount, U>, IEquatable<IQuantity<DecimalAmount, U>>, IEquatable<DecimalQuantity<U>> where U : IUnit

Type Parameters

U

Concrete unit type.

Implements
Inherited Members

Constructors

DecimalQuantity(DecimalAmount, U)

A DecimalAmount paired with an IUnit. Formats as "{Amount} {Unit}".

public DecimalQuantity(DecimalAmount Amount, U Unit)

Parameters

Amount DecimalAmount
Unit U

Properties

Amount

The numeric part.

public DecimalAmount Amount { get; init; }

Property Value

DecimalAmount

Unit

The unit part.

public U Unit { get; init; }

Property Value

U

Methods

Equals(DecimalQuantity<U>)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(DecimalQuantity<U> other)

Parameters

other DecimalQuantity<U>

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.