Extends
Overview
Members-Overview
|
:timapi.constants.Currency |
|
:Number |
|
:Number |
|
:Number |
|
:Number |
|
:Number |
|
:Number |
Methods-Overview
- getDecimalValue() → {Number}
- getMarkupDecimal() → {Number}
- getRateDecimal() → {Number}
- setCurrency(currency)
- setDecimalValue(value)
- setValue(value)
- toString() → {String}
Member-List
Methods
getDecimalValue() → {Number}
Get amount-value in major units as floating point value.
- Overrides:
Returns:
Amount-value in major units as floating point value
Type: Number
getMarkupDecimal() → {Number}
Markup applied to the DCC rate by the DCC provider as major units floating point value.
Returns:
Markup in major units as floating point value
Type: Number
getRateDecimal() → {Number}
Exchange rate in major units as floating point value.
Returns:
Exchange rate in major units as floating point value.
Type: Number
setCurrency(currency)
Set currency to use for transaction. Also sets the exponent. Assign to currency property
directly if you want to keep the exponent unchanged.
Parameters:
Name | Type | Description |
---|---|---|
currency |
timapi.constants.Currency | Currency |
- Overrides:
setDecimalValue(value)
Set amount-value in major units as floating point value
Parameters:
Name | Type | Description |
---|---|---|
value |
Number | Amount-value in major units as floating point value (e.g. 10.5) |
- Overrides:
Throws:
-
Will throw error if amount in minor units is not representable as a 52bit value
-
Will throw error if amount is 0
setValue(value)
Set value of amount.
Parameters:
Name | Type | Description |
---|---|---|
value |
Number | Value of amount as an integer value |
- Overrides:
Throws:
-
Will throw error if it's a floating point number. To make sure it's an integer you can either use Math.floor (8.6 -> 8) or Math.round (8.6 -> 9)
-
Will throw error if amount is not representable as a 52bit value. Use Number.isSafeInteger(value) to check wether value is safe or not
-
Will throw error if amount is 0
toString() → {String}
String representation for debugging purpose.
- Overrides:
Returns:
String representation for debugging purpose
Type: String