Currency

world.money.currency.Currency
See theCurrency companion object
trait Currency extends CurrencyDetails

Represents an actively circulating currency.

All active currencies known to this library are available as predefined singleton objects within the Currencies object.

Attributes

Example
 import world.money.currency.Currencies
val kenyanShilling = Currencies.KES assert(kenyanShilling.name == "Kenyan
Shilling") assert(kenyanShilling.numericCode.value == 404)
assert(kenyanShilling.minorUnit == Some(2)) 
Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Known subtypes
object AED
object AFN
object ALL
object AMD
object AOA
object ARS
object AUD
object AWG
object AZN
object BAM
object BBD
object BDT
object BGN
object BHD
object BIF
object BMD
object BND
object BOB
object BOV
object BRL
object BSD
object BTN
object BWP
object BYN
object BZD
object CAD
object CDF
object CHE
object CHF
object CHW
object CLF
object CLP
object CNY
object COP
object COU
object CRC
object CUP
object CVE
object CZK
object DJF
object DKK
object DOP
object DZD
object EGP
object ERN
object ETB
object EUR
object FJD
object FKP
object GBP
object GEL
object GHS
object GIP
object GMD
object GNF
object GTQ
object GYD
object HKD
object HNL
object HTG
object HUF
object IDR
object ILS
object INR
object IQD
object IRR
object ISK
object JMD
object JOD
object JPY
object KES
object KGS
object KHR
object KMF
object KPW
object KRW
object KWD
object KYD
object KZT
object LAK
object LBP
object LKR
object LRD
object LSL
object LYD
object MAD
object MDL
object MGA
object MKD
object MMK
object MNT
object MOP
object MRU
object MUR
object MVR
object MWK
object MXN
object MXV
object MYR
object MZN
object NAD
object NGN
object NIO
object NOK
object NPR
object NZD
object OMR
object PAB
object PEN
object PGK
object PHP
object PKR
object PLN
object PYG
object QAR
object RON
object RSD
object RUB
object RWF
object SAR
object SBD
object SCR
object SDG
object SEK
object SGD
object SHP
object SLE
object SOS
object SRD
object SSP
object STN
object SVC
object SYP
object SZL
object THB
object TJS
object TMT
object TND
object TOP
object TRY
object TTD
object TWD
object TZS
object UAH
object UGX
object USD
object USN
object UYI
object UYU
object UYW
object UZS
object VED
object VES
object VND
object VUV
object WST
object XAF
object XAG
object XAU
object XBA
object XBB
object XBC
object XBD
object XCD
object XCG
object XDR
object XOF
object XPD
object XPF
object XPT
object XSU
object XTS
object XUA
object XXX
object YER
object ZAR
object ZMW
object ZWG
Show all

Members list

Value members

Abstract methods

def minorUnit: Option[Int]

The number of decimal places for the currency's minor unit.

The number of decimal places for the currency's minor unit.

Attributes

The 3-digit NumericCode.

The 3-digit NumericCode.

Attributes

Concrete methods

transparent inline def apply(value: CurrencyValue | BigDecimal | Long | Int | Double): Money[c.type]
Extension method from world.money.currency

Creates a type-safe Money instance for this specific currency.

Creates a type-safe Money instance for this specific currency.

This factory method provides an ergonomic way to create Money values directly from a currency object. The resulting Money instance is strongly typed with this currency's specific singleton type.

Value parameters

value

The numeric amount for the new Money instance.

Attributes

Returns

A Money instance with its currency type fixed to this specific currency.

Note

Using Double can lead to floating-point precision inaccuracies. Prefer BigDecimal, String, Long, or Int.

Example
import world.money.currency.*
val oneHundredShillings: Money[Currencies.KES.type] = Currencies.KES(100)
val fiftyPounds: Money[Currencies.GBP.type] = Currencies.GBP(50.0)

Inherited methods

def productElementName(n: Int): String

Attributes

Inherited from:
Product
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product
def productPrefix: String

Attributes

Inherited from:
Product

Inherited and Abstract methods

def canEqual(that: Any): Boolean

Attributes

Inherited from:
Equals
def code: CcyCode

The 3-letter uppercase CcyCode.

The 3-letter uppercase CcyCode.

Attributes

Inherited from:
CurrencyDetails
def name: String

The common, human-readable name of the currency.

The common, human-readable name of the currency.

Attributes

Inherited from:
CurrencyDetails
def productArity: Int

Attributes

Inherited from:
Product
def productElement(n: Int): Any

Attributes

Inherited from:
Product