ConversionRate

world.money.conversion.ConversionRate
See theConversionRate companion object
final case class ConversionRate

Represents the conversion rate between two currencies.

Value parameters

base

The base currency.

context

Optional metadata about the rate, such as its source and timestamp.

rate

The conversion factor. This is the value of the term currency that one unit of the base currency is worth.

term

The term (or counter) currency.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

Creates the inverse of this exchange rate (from term to base).

Creates the inverse of this exchange rate (from term to base).

Value parameters

context

A world.money.currency.CurrencyMathContext given instance for division.

Attributes

Returns

Right with the inverted rate, or Left with an world.money.errors.ArithmeticError if the rate is zero and cannot be inverted.

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product