Java Long Number Create toLong(String value)

Here you can find the source of toLong(String value)

Description

to Long

License

Open Source License

Declaration

public static Long toLong(String value) 

Method Source Code

//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));
    }
}

Related

  1. toLong(String time)
  2. toLong(String tStr)
  3. toLong(String v, long def)
  4. toLong(String val)
  5. toLong(String value)
  6. toLong(String value)
  7. toLong(String value)
  8. toLong(String value)
  9. toLong(String value, long _default)