Java Null Value Convert null2Double(Object s, double defValue)

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

Description

null Double

License

Apache License

Declaration

public static double null2Double(Object s, double defValue) 

Method Source Code

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

public class Main {

    public static double null2Double(Object s, double defValue) {
        if (s != null) {
            try {
                return Double.parseDouble(s.toString());
            } catch (Exception e) {
            }/*from   www  .  j ava 2 s .c  o m*/
        }
        return defValue;
    }
}

Related

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