Java Double Number Create toDouble(Object val)

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

Description

to Double

License

Open Source License

Declaration

public static Double toDouble(Object val) 

Method Source Code

//package com.java2s;

public class Main {
    public static Double toDouble(Object val) {
        if (val == null)
            return null;
        if (val instanceof Number)
            return Double.valueOf(((Number) val).doubleValue());

        return Double.valueOf(val.toString());
    }/*from  w w w .j  a  v  a  2s.com*/

    public static String toString(int... results) {
        StringBuilder sb = new StringBuilder();
        sb.append('[');
        sb.append(' ');
        for (int i : results)
            sb.append(i).append(',');
        sb.setCharAt(sb.length() - 1, ' ');
        sb.append(']');
        return sb.toString();
    }
}

Related

  1. toDouble(Object object, Double defaultValue)
  2. toDouble(Object objValue)
  3. toDouble(Object prmIntObject)
  4. toDouble(Object val)
  5. toDouble(Object val)
  6. toDouble(Object value)
  7. toDouble(Object value)
  8. toDouble(Object value)
  9. toDouble(Object value)