Update denominations

This commit is contained in:
nicksavers 2014-05-20 19:21:54 +02:00
parent cf82f9b459
commit d7145ddc09
1 changed files with 11 additions and 4 deletions

View File

@ -5,10 +5,13 @@ import java.math.BigInteger;
public enum Denomination {
WEI(BigInteger.ONE),
SZABO(BigDecimal.valueOf(Math.pow(10, 12)).toBigInteger()),
FINNY(BigDecimal.valueOf(Math.pow(10, 15)).toBigInteger()),
ETHER(BigDecimal.valueOf(Math.pow(10, 18)).toBigInteger());
WEI(newBigInt(0)),
ADA(newBigInt(3)),
BABBAGE(newBigInt(6)),
SHANNON(newBigInt(9)),
SZABO(newBigInt(12)),
FINNY(newBigInt(15)),
ETHER(newBigInt(18));
private BigInteger amount;
@ -19,4 +22,8 @@ public enum Denomination {
public BigInteger getDenomination() {
return amount;
}
private static BigInteger newBigInt(double value) {
return BigDecimal.valueOf(Math.pow(10, value)).toBigInteger();
}
}