Here you can find the source of toDouble(Object obj)
Parameter | Description |
---|---|
obj | the object to be converted |
public static double toDouble(Object obj)
//package com.java2s; public class Main { /**//from w w w . ja va 2s . c o m * Get the double value of this object, only if the object is an instance of Number * * @param obj the object to be converted * @return the double value of the object, or 0.0d if it is not a number. */ public static double toDouble(Object obj) { return (obj instanceof Number) ? ((Number) obj).doubleValue() : 0.0d; } }