@Test(expected = ArithmeticException.class) public void testBtcToSatoshi_tooPrecise2() { btcToSatoshi(new BigDecimal("92233720368.547758079")); }
public static long btcToSatoshi(BigDecimal coins) { return coins.movePointRight(SMALLEST_UNIT_EXPONENT).longValueExact(); }
Coin implements Monetary, Comparable<Coin>, Serializable { public static long btcToSatoshi(BigDecimal coins) { return coins.movePointRight(SMALLEST_UNIT_EXPONENT).longValueExact(); } }
Coin implements Monetary, Comparable<Coin>, Serializable { public static long btcToSatoshi(BigDecimal coins) { return coins.movePointRight(SMALLEST_UNIT_EXPONENT).longValueExact(); } private  Coin(final long satoshis); }
Coin implements Monetary, Comparable<Coin>, Serializable { public static long btcToSatoshi(BigDecimal coins) { return coins.movePointRight(SMALLEST_UNIT_EXPONENT).longValueExact(); } private  Coin(final long satoshis); static Coin valueOf(final long satoshis); @Override int smallestUnitExponent(); @Override long getValue(); static Coin valueOf(final int coins, final int cents); static long btcToSatoshi(BigDecimal coins); static BigDecimal satoshiToBtc(long satoshis); static Coin ofBtc(BigDecimal coins); static Coin ofSat(long satoshis); static Coin parseCoin(final String str); static Coin parseCoinInexact(final String str); Coin add(final Coin value); Coin plus(final Coin value); Coin subtract(final Coin value); Coin minus(final Coin value); Coin multiply(final long factor); Coin times(final long factor); Coin times(final int factor); Coin divide(final long divisor); Coin div(final long divisor); Coin div(final int divisor); Coin[] divideAndRemainder(final long divisor); long divide(final Coin divisor); boolean isPositive(); boolean isNegative(); boolean isZero(); boolean isGreaterThan(Coin other); boolean isLessThan(Coin other); Coin shiftLeft(final int n); Coin shiftRight(final int n); @Override int signum(); Coin negate(); long longValue(); long toSat(); BigDecimal toBtc(); String toFriendlyString(); String toPlainString(); @Override String toString(); @Override boolean equals(final Object o); @Override int hashCode(); @Override int compareTo(final Coin other); }
Coin implements Monetary, Comparable<Coin>, Serializable { public static long btcToSatoshi(BigDecimal coins) { return coins.movePointRight(SMALLEST_UNIT_EXPONENT).longValueExact(); } private  Coin(final long satoshis); static Coin valueOf(final long satoshis); @Override int smallestUnitExponent(); @Override long getValue(); static Coin valueOf(final int coins, final int cents); static long btcToSatoshi(BigDecimal coins); static BigDecimal satoshiToBtc(long satoshis); static Coin ofBtc(BigDecimal coins); static Coin ofSat(long satoshis); static Coin parseCoin(final String str); static Coin parseCoinInexact(final String str); Coin add(final Coin value); Coin plus(final Coin value); Coin subtract(final Coin value); Coin minus(final Coin value); Coin multiply(final long factor); Coin times(final long factor); Coin times(final int factor); Coin divide(final long divisor); Coin div(final long divisor); Coin div(final int divisor); Coin[] divideAndRemainder(final long divisor); long divide(final Coin divisor); boolean isPositive(); boolean isNegative(); boolean isZero(); boolean isGreaterThan(Coin other); boolean isLessThan(Coin other); Coin shiftLeft(final int n); Coin shiftRight(final int n); @Override int signum(); Coin negate(); long longValue(); long toSat(); BigDecimal toBtc(); String toFriendlyString(); String toPlainString(); @Override String toString(); @Override boolean equals(final Object o); @Override int hashCode(); @Override int compareTo(final Coin other); static final int SMALLEST_UNIT_EXPONENT; static final Coin ZERO; static final Coin COIN; static final Coin CENT; static final Coin MILLICOIN; static final Coin MICROCOIN; static final Coin SATOSHI; static final Coin FIFTY_COINS; static final Coin NEGATIVE_SATOSHI; final long value; }