Java Null Value Convert null2Double(Object s)

Here you can find the source of null2Double(Object s)

Description

null Double

License

Apache License

Declaration

public static double null2Double(Object s) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {

    public static double null2Double(Object s) {
        double v = 0.0D;
        if (s != null)
            try {
                v = Double.parseDouble(null2String(s));
            } catch (Exception localException) {
            }// www.  j av  a  2 s  .co  m
        return v;
    }

    public static String null2String(Object s) {
        return s == null ? "" : s.toString().trim();
    }
}

Related

  1. null2blank(String source)
  2. null2Boolean(Object expression, boolean defValue)
  3. null2Boolean(Object s)
  4. null2default(final String str, final String def)
  5. null2dots(Object s)
  6. null2Double(Object s, double defValue)
  7. null2Empty(Object obj)
  8. null2empty(Object s)
  9. null2empty(String str)