@Test void testToLoop() { BigInteger loop = new BigInteger("1000000000000000000"); IconAmount amount = IconAmount.of("1", IconAmount.Unit.ICX); assertEquals(loop, amount.toLoop()); amount = IconAmount.of("1000000000000000000", IconAmount.Unit.LOOP); assertEquals(loop, amount.toLoop()); amount = IconAmount.of(new BigInteger("1"), IconAmount.Unit.ICX); assertEquals(loop, amount.toLoop()); amount = IconAmount.of(new BigInteger("1000"), IconAmount.Unit.ICX); assertEquals(new BigInteger("1000000000000000000000"), amount.toLoop()); amount = IconAmount.of("0.1", IconAmount.Unit.ICX); assertEquals(new BigInteger("100000000000000000"), amount.toLoop()); amount = IconAmount.of(new BigDecimal("0.1"), IconAmount.Unit.ICX); assertEquals(new BigInteger("100000000000000000"), amount.toLoop()); }
public BigInteger toLoop() { return value.multiply(getTenDigit(digit)).toBigInteger(); }
IconAmount { public BigInteger toLoop() { return value.multiply(getTenDigit(digit)).toBigInteger(); } }
IconAmount { public BigInteger toLoop() { return value.multiply(getTenDigit(digit)).toBigInteger(); } IconAmount(BigDecimal value, int digit); }
IconAmount { public BigInteger toLoop() { return value.multiply(getTenDigit(digit)).toBigInteger(); } IconAmount(BigDecimal value, int digit); int getDigit(); @Override String toString(); BigInteger asInteger(); BigDecimal asDecimal(); BigInteger toLoop(); IconAmount convertUnit(Unit unit); IconAmount convertUnit(int digit); static IconAmount of(BigDecimal loop, int digit); static IconAmount of(BigDecimal loop, Unit unit); static IconAmount of(String loop, int digit); static IconAmount of(String loop, Unit unit); static IconAmount of(BigInteger loop, int digit); static IconAmount of(BigInteger loop, Unit unit); }
IconAmount { public BigInteger toLoop() { return value.multiply(getTenDigit(digit)).toBigInteger(); } IconAmount(BigDecimal value, int digit); int getDigit(); @Override String toString(); BigInteger asInteger(); BigDecimal asDecimal(); BigInteger toLoop(); IconAmount convertUnit(Unit unit); IconAmount convertUnit(int digit); static IconAmount of(BigDecimal loop, int digit); static IconAmount of(BigDecimal loop, Unit unit); static IconAmount of(String loop, int digit); static IconAmount of(String loop, Unit unit); static IconAmount of(BigInteger loop, int digit); static IconAmount of(BigInteger loop, Unit unit);  }