MoneyConversionResult Struct
Definition
Captures the audit trail of a single runtime-tagged currency conversion: the source and settled target amounts, the exchange rate applied, the monetary context that governed rounding, and how much rounding moved the result.
public readonly struct MoneyConversionResult : IEquatable<MoneyConversionResult>
- Implements
- Inherited Members
- Extension Methods
Constructors
MoneyConversionResult(Money, Money, ExchangeRate, MonetaryContext, decimal?)
Captures the audit trail of a single runtime-tagged currency conversion: the source and settled target amounts, the exchange rate applied, the monetary context that governed rounding, and how much rounding moved the result.
public MoneyConversionResult(Money Source, Money Target, ExchangeRate Rate, MonetaryContext Context, decimal? RoundingAdjustment)
Parameters
SourceMoneyThe original source amount.
TargetMoneyThe converted amount, rounded according to
Context.RateExchangeRateThe exchange rate applied to produce
Target.ContextMonetaryContextThe monetary context that governed rounding.
RoundingAdjustmentdecimal?The signed difference between the rounded target amount and the exact (unrounded) converted amount, or null when rounding was deferred.
Properties
Context
The monetary context that governed rounding.
public MonetaryContext Context { get; init; }
Property Value
Rate
The exchange rate applied to produce Target.
public ExchangeRate Rate { get; init; }
Property Value
RoundingAdjustment
The signed difference between the rounded target amount and the exact (unrounded) converted amount, or null when rounding was deferred.
public decimal? RoundingAdjustment { get; init; }
Property Value
Source
The original source amount.
public Money Source { get; init; }
Property Value
Target
The converted amount, rounded according to Context.
public Money Target { get; init; }
Property Value
Methods
Deconstruct(out Money, out Money, out ExchangeRate, out MonetaryContext, out decimal?)
public void Deconstruct(out Money Source, out Money Target, out ExchangeRate Rate, out MonetaryContext Context, out decimal? RoundingAdjustment)
Parameters
SourceMoneyTargetMoneyRateExchangeRateContextMonetaryContextRoundingAdjustmentdecimal?
Equals(MoneyConversionResult)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(MoneyConversionResult other)
Parameters
otherMoneyConversionResultAn object to compare with this object.
Returns
Equals(object)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
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.
Operators
operator ==(MoneyConversionResult, MoneyConversionResult)
public static bool operator ==(MoneyConversionResult left, MoneyConversionResult right)
Parameters
leftMoneyConversionResultrightMoneyConversionResult
Returns
operator !=(MoneyConversionResult, MoneyConversionResult)
public static bool operator !=(MoneyConversionResult left, MoneyConversionResult right)
Parameters
leftMoneyConversionResultrightMoneyConversionResult
Returns
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |