Integer divides this money by that BigDecimal and returns the remainder
Integer divides this money by that BigDecimal and returns the remainder
BigDecimal
Money
Multiplies this money by that squants.market.CurrencyExchangeRate and returns the equal value in the other currency.
Multiplies this money by that squants.market.CurrencyExchangeRate and returns the equal value in the other currency.
Delegates to CurrencyExchangeRate * Money
BigDecimal
Multiplies this money by that BigDecimal and returns a new Money
Multiplies this money by that BigDecimal and returns a new Money
BigDecimal
Money
moneyPlus *
moneyMinus *
toThe
Divide this money by another (non-money) Quantity and return a Price
Divide this money by another (non-money) Quantity and return a Price
Quantity Type
Quantity
Price[A]
Divides this money by that BigDecimal and returns a new Money
Divides this money by that BigDecimal and returns a new Money
BigDecimal
Money
Integer divides this money by that BigDecimal and returns the quotient and the remainder
Integer divides this money by that BigDecimal and returns the quotient and the remainder
BigDecimal
(Money, Money)
approx
approx
Returns the absolute value of this Quantity
the amount of money
Returns boolean result of approximate equality comparison
Returns boolean result of approximate equality comparison
Quantity
Quantity
Override for Quantity.compare to only work on Moneys of like Currency
the currency in which the money is denominated
The Dimension this quantity represents
Override for Quantity.divide to only work on Moneys of like Currency Cross currency subtractions should use moneyMinus
Divide this quantity by some number
Returns a Pair that includes the result of divideToInteger and remainder
Returns a Pair that includes the result of divideToInteger and remainder
Quantity
(Double, Quantity)
Returns a Pair that includes the result of divideToInteger and remainder
Returns a Pair that includes the result of divideToInteger and remainder
Double
(Quantity, Quantity)
Override for Quantity.equal to only match Moneys of like Currency
Override of hashCode
Override of hashCode
Reboxes this Money value in a Money in the given Currency
Reboxes this Money value in a Money in the given Currency
Currency
MoneyContext required for cross currency operations
Money
NoSuchExchangeRateException
when no exchange rate is available
Returns an equivalent Quantity boxed with the supplied Unit
Returns an equivalent Quantity boxed with the supplied Unit
UnitOfMeasure[A]
Quantity
Applies a function to the underlying value of the Quantity, returning a new Quantity in the same unit
Applies a function to the underlying value of the Quantity, returning a new Quantity in the same unit
Double => Double function
Override for Quantity.max to only work on Moneys of like Currency
Override for Quantity.max to only work on Moneys of like Currency
Override Quantity.minus to only work on like currencies Cross currency subtractions should use moneyMinus
Supports compare operation on Moneys of dislike Currency
Supports compare operation on Moneys of dislike Currency
Money
MoneyContext
Divides this money by that money and returns the ratio between the converted amounts
Divides this money by that money and returns the ratio between the converted amounts
Money
MoneyContext
Supports equality comparisons on Moneys of dislike Currency
Supports equality comparisons on Moneys of dislike Currency
Money
MoneyContext
Supports max operation on Moneys of dislike Currency
Supports max operation on Moneys of dislike Currency
Money
MoneyContext
Supports min operation on Moneys of dislike Currency
Supports min operation on Moneys of dislike Currency
Money
MoneyContext
Subtracts that Money from this Money converted to this.currency via context
Subtracts that Money from this Money converted to this.currency via context
Money
MoneyContext required for cross currency operations
Money
NoSuchExchangeRateException
when no exchange rate is available
Supports non-equality comparisons on Moneys of dislike Currency
Supports non-equality comparisons on Moneys of dislike Currency
Money
MoneyContext
Adds this Money to that Money converted to this.currency via context
Adds this Money to that Money converted to this.currency via context
Money
MoneyContext required for cross currency operations
Money
NoSuchExchangeRateException
when no exchange rate is available
Returns the negative value of this Quantity
Returns true if this value is not within (contains) the range
Returns true if this value is not within (contains) the range
QuantityRange
Boolean
Overrides Quantity.plus to only work on like currencies.
Returns a QuantityRange representing the range for this value +- that
Returns a QuantityRange representing the range for this value +- that
Quantity
QuantityRange
Returns the remainder of a division by a like quantity
Returns the remainder of a division by a like quantity
Quantity
Double
Returns the remainder of a division by a number
Returns the remainder of a division by a number
Quantity
Quantity
Multiply this quantity by some number
Convert this Money to a Double representing the currency unit
Convert this Money to a Double representing the currency unit
Currency
MoneyContext required for cross currency operations
Double
NoSuchExchangeRateException
when no exchange rate is available
Returns a Double representing the quantity in terms of the supplied unit
Returns a Double representing the quantity in terms of the supplied unit
val d = Feet(3) (d to Inches) should be(36)
UnitOfMeasure[A]
Double
Returns a QuantityRange that goes from this to that
Returns a QuantityRange that goes from this to that
Quantity
QuantityRange
Returns a string formatted with the value and currency symbol
Returns a string formatted with the value and currency symbol
eg USD(100) => "$100.00"
String
Returns a string formatted with the value and currency code
Returns a string representing the quantity's value in the given unit
in the given format
Returns a string representing the quantity's value in the given unit
in the given format
UnitOfMeasure[A] with UnitConverter
String containing the format for the value (ie "%.3f")
String
Returns a string representing the quantity's value in the given unit
Returns a string representing the quantity's value in the given unit
UnitOfMeasure[A] with UnitConverter
String
Combines with that Money to create an squants.market.CurrencyExchangeRate
Combines with that Money to create an squants.market.CurrencyExchangeRate
Exchange Rates on the same currency are not supported
val rate: CurrencyExchangeRate = JPY(100) toThe USD(1)
Money
scala.IllegalArgumentException
if the that.currency matches this.currency
Returns a pair representing the numeric value and the uom's symbol
Returns a pair representing the numeric value and the uom's symbol
UnitOfMeasure[A]
Returns a tuple representing the numeric value and the unit's symbol
Returns a tuple representing the numeric value and the unit's symbol
The Unit of Measure the value represents
The value of the quantity given the unit
Returns true if this value is within (contains) the range
Returns true if this value is within (contains) the range
QuantityRange
Boolean
approx
approx
approx
approx
Represents a quantity of Money.
Money is similar to other quantities in that it represents an amount of something - purchasing power - and it is measured in units - currencies.
The main difference is that the conversion rate between currencies can not be certain at compile. (In fact it may not always be so easy to know them at runtime as well.)
To address this diversion from the way most other quantities work, Money overrides several of the standard methods and operators to ensure one of two rules is followed:
1) this and that are in the same currency, or 2) there is in an implicit MoneyContext in scope (which may or may not have the applicable exchange rate)
Methods and operations applied to moneys of different currencies may throw a NoSuchExchangeRateException if the implicit MoneyContext does not contain the Rate(s) necessary to perform the conversion.
The defaultMoneyContext includes USD as the default currency, a list of ~20 other currencies and NO exchange rates
0.1