Java Double Number Create toDouble(Object value, double nullValue)

Here you can find the source of toDouble(Object value, double nullValue)

Description

to Double

License

Open Source License

Declaration

public static double toDouble(Object value, double nullValue) 

Method Source Code

//package com.java2s;
/*//  ww w. j a va  2 s  .  c  o  m
 * This file is part of the Jose Project
 * see http://jose-chess.sourceforge.net/
 * (c) 2002-2006 Peter Sch?fer
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 */

public class Main {
    public static double toDouble(Object value, double nullValue) {
        if (value == null)
            return nullValue;
        if (value instanceof Number)
            return ((Number) value).doubleValue();
        else
            return Double.parseDouble(value.toString());
    }
}

Related

  1. toDouble(Object value)
  2. toDouble(Object value)
  3. toDouble(Object value)
  4. toDouble(Object value)
  5. toDouble(Object value)
  6. toDouble(Object x)
  7. toDouble(short[] arr)
  8. toDouble(short[] src)
  9. toDouble(String aString)