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
TypeRoundingTypeThe rounding's type.
Precisionint?Digitint?
Properties
Digit
public int? Digit { get; init; }
Property Value
- int?
Precision
public int? Precision { get; init; }
Property Value
- int?
Type
The rounding's type.
public RoundingType Type { get; init; }
Property Value
Methods
Deconstruct(out RoundingType, out int?, out int?)
public void Deconstruct(out RoundingType Type, out int? Precision, out int? Digit)
Parameters
TypeRoundingTypePrecisionint?Digitint?
Equals(CurrencyRounding?)
public bool Equals(CurrencyRounding? other)
Parameters
otherCurrencyRounding
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
Of(Rounding)
Describes a rounding.
public static CurrencyRounding Of(Rounding rounding)
Parameters
roundingRoundingThe rounding.
Returns
- CurrencyRounding
Its type, and its precision and digit unless its type is None.
Exceptions
- ArgumentNullException
roundingis null.
ToRounding()
The rounding this describes.
public Rounding ToRounding()
Returns
Exceptions
- ArgumentException
A type other than None without a precision or digit, or None with one.
ToString()
public override string ToString()
Returns
Operators
operator ==(CurrencyRounding?, CurrencyRounding?)
public static bool operator ==(CurrencyRounding? left, CurrencyRounding? right)
Parameters
leftCurrencyRoundingrightCurrencyRounding
Returns
operator !=(CurrencyRounding?, CurrencyRounding?)
public static bool operator !=(CurrencyRounding? left, CurrencyRounding? right)
Parameters
leftCurrencyRoundingrightCurrencyRounding