Interface IMoneyBag
Represents a bag of monetary values in one or more currencies.
Inherited Members
Namespace: Singulink.Globalization
Assembly: Singulink.Globalization.Currency.dll
Syntax
public interface IMoneyBag : ICollection<MonetaryValue>, IReadOnlyMoneyBag, IReadOnlyCollection<MonetaryValue>, IEnumerable<MonetaryValue>, IEnumerable, IFormattable
Properties
| Name | Description |
|---|---|
| Count | Gets the number of values/currencies in this bag. |
Methods
| Name | Description |
|---|---|
| Add(MonetaryValue) | Adds the specified value to this bag. |
| Add(decimal, Currency) | Adds the specified currency and amount to this bag. |
| Add(decimal, string) | Adds the specified currency and amount to this bag. |
| AddRange(IEnumerable<MonetaryValue>) | Adds the specified values to this bag. |
| Create(CurrencyRegistry, IEnumerable<MonetaryValue>) | Creates a bag that uses the specified currency registry and adds all the specified values. |
| Remove(Currency) | Removes the value with the given currency. |
| Remove(string) | Removes the value with the given currency code. |
| RemoveAll(IEnumerable<Currency>) | Removes all the values from this bag that match the specified currencies. |
| RemoveAll(Func<MonetaryValue, bool>) | Removes all the values from this bag that match the specified predicate and returns the resulting bag. |
| RoundToCurrencyDigits() | Rounds each value's amount to its currency's DecimalDigits using ToEven midpoint rounding (i.e. "banker's rounding"). |
| RoundToCurrencyDigits(MidpointRounding) | Rounds each value's amount to its currency's DecimalDigits using the specified midpoint rounding mode. |
| SetAmount(decimal, Currency) | Sets the amount the bag contains for the specified currency code. |
| SetAmount(decimal, string) | Sets the amount the bag contains for the specified currency code. |
| SetValue(MonetaryValue) | Sets the value this bag contains for the currency of the specified value. |
| Subtract(MonetaryValue) | Subtracts the specified value from this bag. Zero amounts are not trimmed from the bag. |
| Subtract(decimal, Currency) | Adds the specified currency and amount to this bag. |
| Subtract(decimal, string) | Subtracts the specified currency and amount from this bag. Zero amounts are not trimmed from the bag. |
| SubtractRange(IEnumerable<MonetaryValue>) | Subtracts the specified values from this bag. Zero amounts are not trimmed from the bag. |
| TransformAmounts(Func<decimal, decimal>) | Applies the specified transformation to each value's amount in this bag. |
| TransformAmounts(Func<decimal, decimal?>) | Applies the specified transformation to each value's amount in this bag. Amounts transformed to a null amount are removed. |
| TransformValues(Func<MonetaryValue, decimal>) | Applies the specified transformation to each value's amount in this bag. |
| TransformValues(Func<MonetaryValue, decimal?>) | Applies the specified transformation to each value's amount in this bag. Values transformed to a null amount are removed. |
| TrimZeroAmounts() | Removes all zero amounts from this bag. |