Java Object to Double objectToDouble(Object obj)

Here you can find the source of objectToDouble(Object obj)

Description

object To Double

License

Apache License

Declaration

public static double objectToDouble(Object obj) 

Method Source Code

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

public class Main {

    public static double objectToDouble(Object obj) {
        return objectToDouble(obj, 0f);
    }/*w  w w . j  ava2  s  .com*/

    public static double objectToDouble(Object obj, double added) {
        double result = 0;
        try {
            result = Double.parseDouble(obj.toString());
        } catch (Exception e) {
            result = added;
        }
        return result;
    }
}

Related

  1. castToDoubles(final int[] ints)
  2. objectToDouble(Object o)
  3. objectToDouble(Object o)
  4. objectToDouble(Object o)
  5. objectToDouble(Object Obj)
  6. objectToDouble(Object obj)
  7. objectToDouble(Object p1)
  8. objToDouble(Object obj)
  9. objToDouble(Object obj)