Table of Contents

Class CurrencyRounding

Namespace
NanoQL.Extensions.Conventions
Assembly
NanoQL.Extensions.dll

A currency's rounding convention: QuantLib's Rounding, its type, and for every type but None its precision and rounding digit.

public sealed record CurrencyRounding : IEquatable<CurrencyRounding>
Inheritance
CurrencyRounding
Implements
Inherited Members

Constructors

CurrencyRounding(RoundingType, int?, int?)

A currency's rounding convention: QuantLib's Rounding, its type, and for every type but None its precision and rounding digit.

public CurrencyRounding(RoundingType Type, int? Precision = null, int? Digit = null)

Parameters

Type RoundingType

The rounding's type.

Precision int?

The decimal places, or null for None.

Digit int?

The rounding digit, or null for None.

Properties

Digit

The rounding digit, or null for None.

public int? Digit { get; init; }

Property Value

int?

Precision

The decimal places, or null for None.

public int? Precision { get; init; }

Property Value

int?

Type

The rounding's type.

public RoundingType Type { get; init; }

Property Value

RoundingType

Methods

Deconstruct(out RoundingType, out int?, out int?)

public void Deconstruct(out RoundingType Type, out int? Precision, out int? Digit)

Parameters

Type RoundingType
Precision int?
Digit int?

Equals(CurrencyRounding?)

public bool Equals(CurrencyRounding? other)

Parameters

other CurrencyRounding

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

Of(Rounding)

Describes a rounding.

public static CurrencyRounding Of(Rounding rounding)

Parameters

rounding Rounding

The rounding.

Returns

CurrencyRounding

Its type, and its precision and digit unless its type is None.

Exceptions

ArgumentNullException

rounding is null.

ToRounding()

The rounding this describes.

public Rounding ToRounding()

Returns

Rounding

QuantLib's no-rounding for None, else a rounding of the precision, type and digit.

Exceptions

ArgumentException

A type other than None without a precision or digit, or None with one.

ToString()

public override string ToString()

Returns

string

Operators

operator ==(CurrencyRounding?, CurrencyRounding?)

public static bool operator ==(CurrencyRounding? left, CurrencyRounding? right)

Parameters

left CurrencyRounding
right CurrencyRounding

Returns

bool

operator !=(CurrencyRounding?, CurrencyRounding?)

public static bool operator !=(CurrencyRounding? left, CurrencyRounding? right)

Parameters

left CurrencyRounding
right CurrencyRounding

Returns

bool