Currency

Represents a currency, a system of money in common use within a specific environment over time.

Inheritors

Types

Link copied to clipboard
object Factory

A Currency factory.

Properties

Link copied to clipboard

The code of the currency.

Link copied to clipboard

The minor units (i.e., the decimal places) of the currency.

Link copied to clipboard

The name of the currency.

Link copied to clipboard

The secondary code of the currency

Link copied to clipboard

The graphical symbol of the currency.

Link copied to clipboard
open val type: CurrencyType

The type of the currency.

Functions

Link copied to clipboard
open operator override fun compareTo(other: Currency): Int
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
infix fun Currency.money(amount: Number): Money

Creates a Money based on this Currency. Example:

infix fun Currency.money(values: Iterable<Number>): Iterable<Money>

Transforms a collection of Number into Money based on this Currency. Calculations using them are rounded using a Rounding strategy configured with RoundingMode.HALF_EVEN.

fun Currency.money(amount: Number, mode: RoundingMode): Money

Creates a Money based on this Currency. Calculations using it are rounded using a Rounding strategy configured with the specified mode.

Transforms a collection of Number into Money based on this Currency. Calculations using them are rounded using a Rounding strategy configured with the specified mode.

Link copied to clipboard

Creates a Money representing the smallest unit of value based on this Currency. Example:

Creates a Money representing the smallest unit of value based on this Currency. Calculations using it are rounded using a Rounding strategy configured with the specified mode.

Link copied to clipboard

Returns a string representation of the object, including all public properties.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard

Creates a Money based on this Currency with its amount set to zero. Example:

infix fun Currency.zero(mode: RoundingMode): Money

Creates a Money based on this Currency with its amount set to zero. Calculations using it are rounded using a Rounding strategy configured with the specified mode.