Here you can find the source of convertsToLong(double v)
public static long convertsToLong(double v)
//package com.java2s; //License from project: Apache License import java.math.BigDecimal; public class Main { public static long convertsToLong(double v) { BigDecimal b = new BigDecimal(v); return b.longValue(); }/* w ww .ja v a 2 s .c o m*/ }