Here you can find the source of toDouble(Object objValue)
Parameter | Description |
---|---|
objValue | Object |
public static double toDouble(Object objValue)
//package com.java2s; /*//from ww w. jav a 2 s. co m * Copyright 2005-2020 GreenTube Team All rights reserved. * Support: Huxg * License: CND team license */ public class Main { /** * * * @param objValue Object * * @return double */ public static double toDouble(Object objValue) { if (objValue != null) { if (objValue instanceof Number) { return ((Number) objValue).doubleValue(); } else { return Double.parseDouble(objValue.toString()); } } else return 0; } /** * * * @param objValue Object * * @return String */ public static String toString(Object objValue) { if (objValue != null) return objValue.toString(); else return null; } }