Currency
in package
Table of Contents
Methods
- convertToDecimals() : string
- Method for safe conversion from coin/token decimals.
- getConversionFactor() : int
- Get the conversion factor based on the coin or token symbol.
- throwIfNotInteger() : void
Methods
convertToDecimals()
Method for safe conversion from coin/token decimals.
public
static convertToDecimals(string $amount, string $coinSymbol[, string|null $tokenSymbol = null ]) : string
Parameters
- $amount : string
- $coinSymbol : string
-
(which should be a NetworkSymbol)
- $tokenSymbol : string|null = null
-
(which should be a TokenSymbol)
Tags
Return values
stringgetConversionFactor()
Get the conversion factor based on the coin or token symbol.
private
static getConversionFactor(string $coinSymbol[, string|null $tokenSymbol = null ]) : int
Parameters
- $coinSymbol : string
- $tokenSymbol : string|null = null
Return values
intthrowIfNotInteger()
private
static throwIfNotInteger(mixed $amount) : void
Parameters
- $amount : mixed