Java Double Number Create toDouble(Object o)

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

Description

to Double

License

Apache License

Declaration

public static double toDouble(Object o) 

Method Source Code

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

public class Main {
    public static double toDouble(Object o) {
        if (o instanceof Double)
            return (Double) o;
        if (o instanceof Integer)
            return (double) ((Integer) o);
        throw new RuntimeException("Can't convert to double: " + o);
    }/*  w w w. j  av a 2 s. co  m*/
}

Related

  1. toDouble(Object _value, double _default)
  2. toDouble(Object argSource)
  3. toDouble(Object literal)
  4. toDouble(Object number)
  5. toDouble(Object number)
  6. toDouble(Object o)
  7. toDouble(Object o)
  8. toDouble(Object o)
  9. toDouble(Object o)