Added in API level 24

CurrencyAmount


open class CurrencyAmount : Measure

An amount of currency, consisting of a Number and a Currency. CurrencyAmount objects are immutable.

Summary

Public constructors
CurrencyAmount(number: Double, currency: Currency!)

Constructs a new object given a double value and a currency.

CurrencyAmount(number: Double, currency: Currency!)

Constructs a new object given a double value and a Java currency.

CurrencyAmount(number: Number!, currency: Currency!)

Constructs a new object given a number and a currency.

CurrencyAmount(number: Number!, currency: Currency!)

Constructs a new object given a number and a Java currency.

Public methods
open Currency!

Returns the currency of this object.

Inherited functions
Boolean equals(other: Any?)

Returns true if the given object is equal to this object.

Number! getNumber()

Returns the numeric value of this object.

MeasureUnit! getUnit()

Returns the unit of this object.

Int hashCode()

Returns a hashcode for this object.

String toString()

Returns a string representation of this object.

Public constructors

CurrencyAmount

Added in API level 24
CurrencyAmount(
    number: Double,
    currency: Currency!)

Constructs a new object given a double value and a currency.

Parameters
number Double: a double value
currency Currency!: the currency

CurrencyAmount

Added in API level 29
CurrencyAmount(
    number: Double,
    currency: Currency!)

Constructs a new object given a double value and a Java currency.

Parameters
number Double: a double value
currency Currency!: the currency

CurrencyAmount

Added in API level 24
CurrencyAmount(
    number: Number!,
    currency: Currency!)

Constructs a new object given a number and a currency.

Parameters
number Number!: the number
currency Currency!: the currency

CurrencyAmount

Added in API level 29
CurrencyAmount(
    number: Number!,
    currency: Currency!)

Constructs a new object given a number and a Java currency.

Parameters
number Number!: the number
currency Currency!: the currency

Public methods

getCurrency

Added in API level 24
open fun getCurrency(): Currency!

Returns the currency of this object.

Return
Currency! this object's Currency