Here you can find the source of bigDecimalToLong(BigDecimal value)
public static Long bigDecimalToLong(BigDecimal value)
//package com.java2s; //License from project: Open Source License import java.math.BigDecimal; public class Main { public static Long bigDecimalToLong(BigDecimal value) { return value.setScale(0, BigDecimal.ROUND_HALF_UP).longValue(); }// ww w .ja v a 2s . c o m }