Here you can find the source of bigDecimalToLong(BigDecimal bigDecimal)
public static Long bigDecimalToLong(BigDecimal bigDecimal)
//package com.java2s; //License from project: Open Source License import java.math.BigDecimal; import java.math.RoundingMode; public class Main { public static final int DECIMAL_SCALE = 8; public static final RoundingMode ROUNDING_MODE = RoundingMode.HALF_UP; private static final BigDecimal SATOSHIS = new BigDecimal(100000000); public static Long bigDecimalToLong(BigDecimal bigDecimal) { bigDecimal.setScale(DECIMAL_SCALE, ROUNDING_MODE); return bigDecimal.multiply(SATOSHIS).longValue(); }//from w ww . j a va2 s. co m }