public class IotaUnitConverter extends Object
Constructor and Description |
---|
IotaUnitConverter() |
Modifier and Type | Method and Description |
---|---|
static double |
convertAmountTo(long amount,
IotaUnits target)
Convert amount to target unit.
|
static String |
convertRawIotaAmountToDisplayText(long amount,
boolean extended)
Convert the iota amount to text.
|
static long |
convertUnits(long amount,
IotaUnits fromUnit,
IotaUnits toUnit)
Convert the iota amount.
|
static String |
createAmountDisplayText(double amountInUnit,
IotaUnits unit,
boolean extended)
Create amount text.
|
static IotaUnits |
findOptimalIotaUnitToDisplay(long amount)
Finds the optimal unit to display the specified amount in.
|
public static long convertUnits(long amount, IotaUnits fromUnit, IotaUnits toUnit)
amount
- The amount.fromUnit
- The source unit e.g. the unit of amount.toUnit
- The target unit.public static String convertRawIotaAmountToDisplayText(long amount, boolean extended)
amount
- The amount.extended
- Extended length.public static double convertAmountTo(long amount, IotaUnits target)
amount
- The amount.public static String createAmountDisplayText(double amountInUnit, IotaUnits unit, boolean extended)
amountInUnit
- The amount in units.unit
- The unit.extended
- Extended length.public static IotaUnits findOptimalIotaUnitToDisplay(long amount)
amount
- The amount.Copyright © 2018. All rights reserved.