Java Double Number Create toDouble(Object obj)

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

Description

This method convert object to Double.

License

BSD License

Parameter

Parameter Description
obj Object to be convert.

Return

Double value.

Declaration

public static double toDouble(Object obj) 

Method Source Code

//package com.java2s;
/*L//from ww  w  .j av  a  2 s  .  c om
 * Copyright Washington University in St. Louis, SemanticBits, Persistent Systems, Krishagni.
 *
 * Distributed under the OSI-approved BSD 3-Clause License.
 * See http://ncip.github.com/commons-module/LICENSE.txt for details.
 */

public class Main {
    /**
     *  This method convert object to Double.
     * @param obj Object to be convert.
     * @return Double value.
     */
    public static double toDouble(Object obj) {
        double value = 0;
        if (obj != null) {
            value = ((Double) obj).doubleValue();
        }
        return value;
    }
}

Related

  1. toDouble(Object o)
  2. toDouble(Object o)
  3. toDouble(Object o)
  4. toDouble(Object ob, Double defaultDouble)
  5. toDouble(Object obj)
  6. toDouble(Object obj)
  7. toDouble(Object obj)
  8. toDouble(Object obj)
  9. toDouble(Object obj)