Here you can find the source of toLong(String value)
public static Long toLong(String value)
//package com.java2s; //License from project: Open Source License public class Main { public static Long toLong(String value) { if (null == value) { return null; }/*from ww w. j a va 2 s . co m*/ value = value.trim(); if ("null".equals(value)) { return null; } Double d = Double.parseDouble(value); return d.longValue(); } public static Long toLong(Object value) { if (null == value) { return null; } return toLong(String.valueOf(value)); } }