Stay organized with collections
Save and categorize content based on your preferences.
CurrencyAmount
open class CurrencyAmount : Measure
An amount of currency, consisting of a Number and a Currency. CurrencyAmount objects are immutable.
Summary
Public constructors |
Constructs a new object given a double value and a currency.
|
Constructs a new object given a double value and a Java currency.
|
Constructs a new object given a number and a currency.
|
Constructs a new object given a number and a Java currency.
|
Public methods |
open Currency! |
Returns the currency of this object.
|
Public constructors
CurrencyAmount
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
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
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
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
open fun getCurrency(): Currency!
Returns the currency of this object.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# CurrencyAmount\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nCurrencyAmount\n==============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/icu/util/CurrencyAmount \"View this page in Java\") \n\n```\nopen class CurrencyAmount : Measure\n```\n\n|---|---|--------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) |||\n| ↳ | [android.icu.util.Measure](/reference/kotlin/android/icu/util/Measure) ||\n| | ↳ | [android.icu.util.CurrencyAmount](#) |\n\nAn amount of currency, consisting of a Number and a Currency. CurrencyAmount objects are immutable.\n\nSummary\n-------\n\n| Public constructors ||\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [CurrencyAmount](#CurrencyAmount(kotlin.Double,%20android.icu.util.Currency))`(`number:` `[Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html)`, `currency:` `[Currency](/reference/kotlin/android/icu/util/Currency)!`)` Constructs a new object given a double value and a currency. |\n| [CurrencyAmount](#CurrencyAmount(kotlin.Double,%20java.util.Currency))`(`number:` `[Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html)`, `currency:` `[Currency](../../../java/util/Currency.html#)!`)` Constructs a new object given a double value and a Java currency. |\n| [CurrencyAmount](#CurrencyAmount(kotlin.Number,%20android.icu.util.Currency))`(`number:` `[Number](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-number/index.html)!`, `currency:` `[Currency](/reference/kotlin/android/icu/util/Currency)!`)` Constructs a new object given a number and a currency. |\n| [CurrencyAmount](#CurrencyAmount(kotlin.Number,%20java.util.Currency))`(`number:` `[Number](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-number/index.html)!`, `currency:` `[Currency](../../../java/util/Currency.html#)!`)` Constructs a new object given a number and a Java currency. |\n\n| Public methods ||\n|---------------------------------------------------------------|------------------------------------------------------------------------|\n| open [Currency](/reference/kotlin/android/icu/util/Currency)! | [getCurrency](#getCurrency())`()` Returns the currency of this object. |\n\n| Inherited functions ||\n|---|---|\n| From class [Measure](/reference/kotlin/android/icu/util/Measure) |------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [equals](/reference/kotlin/android/icu/util/Measure#equals(kotlin.Any))`(`other:` `[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)?`)` Returns true if the given object is equal to this object. \u003cbr /\u003e | | [Number](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-number/index.html)! | [getNumber](/reference/kotlin/android/icu/util/Measure#getNumber())`()` Returns the numeric value of this object. \u003cbr /\u003e | | [MeasureUnit](/reference/kotlin/android/icu/util/MeasureUnit)! | [getUnit](/reference/kotlin/android/icu/util/Measure#getUnit())`()` Returns the unit of this object. \u003cbr /\u003e | | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [hashCode](/reference/kotlin/android/icu/util/Measure#hashCode())`()` Returns a hashcode for this object. \u003cbr /\u003e | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [toString](/reference/kotlin/android/icu/util/Measure#toString())`()` Returns a string representation of this object. \u003cbr /\u003e | ||\n\nPublic constructors\n-------------------\n\n### CurrencyAmount\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nCurrencyAmount(\n number: Double, \n currency: Currency!)\n```\n\nConstructs a new object given a double value and a currency.\n\n| Parameters ||\n|------------|--------------------------------------------------------------------------------------------------|\n| `number` | [Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html): a double value |\n| `currency` | [Currency](/reference/kotlin/android/icu/util/Currency)!: the currency |\n\n### CurrencyAmount\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nCurrencyAmount(\n number: Double, \n currency: Currency!)\n```\n\nConstructs a new object given a double value and a Java currency.\n\n| Parameters ||\n|------------|--------------------------------------------------------------------------------------------------|\n| `number` | [Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html): a double value |\n| `currency` | [Currency](../../../java/util/Currency.html#)!: the currency |\n\n### CurrencyAmount\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nCurrencyAmount(\n number: Number!, \n currency: Currency!)\n```\n\nConstructs a new object given a number and a currency.\n\n| Parameters ||\n|------------|-----------------------------------------------------------------------------------------------|\n| `number` | [Number](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-number/index.html)!: the number |\n| `currency` | [Currency](/reference/kotlin/android/icu/util/Currency)!: the currency |\n\n### CurrencyAmount\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nCurrencyAmount(\n number: Number!, \n currency: Currency!)\n```\n\nConstructs a new object given a number and a Java currency.\n\n| Parameters ||\n|------------|-----------------------------------------------------------------------------------------------|\n| `number` | [Number](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-number/index.html)!: the number |\n| `currency` | [Currency](../../../java/util/Currency.html#)!: the currency |\n\nPublic methods\n--------------\n\n### getCurrency\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getCurrency(): Currency!\n```\n\nReturns the currency of this object.\n\n| Return ||\n|----------------------------------------------------------|------------------------|\n| [Currency](/reference/kotlin/android/icu/util/Currency)! | this object's Currency |"]]