Java Double Number Create toDouble(Object value)

Here you can find the source of toDouble(Object value)

Description

to Double

License

Open Source License

Declaration

public static final double toDouble(Object value) 

Method Source Code

//package com.java2s;

public class Main {
    public static final double toDouble(Object value) {
        if (value instanceof Number)
            return ((Number) value).doubleValue();
        else if (value == null)
            return 0;
        else/*from w w  w.  ja va 2  s  . c  o  m*/
            return Double.parseDouble(value.toString());
    }

    public static final String toString(Object value) {
        if (value == null)
            return null;

        return value.toString();
    }
}

Related

  1. toDouble(Object prmIntObject)
  2. toDouble(Object val)
  3. toDouble(Object val)
  4. toDouble(Object val)
  5. toDouble(Object value)
  6. toDouble(Object value)
  7. toDouble(Object value)
  8. toDouble(Object value)
  9. toDouble(Object value, double nullValue)