Java Utililty Methods Double Number Create

List of utility methods to do Double Number Create

Description

The list of methods to do Double Number Create are organized into topic(s).

Method

DoubletoDouble(Object val)
to Double
if (val == null)
    return null;
if (val instanceof Number)
    return Double.valueOf(((Number) val).doubleValue());
return Double.valueOf(val.toString());
DoubletoDouble(Object val)
to Double
if (val == null) {
    return 0D;
try {
    return Double.valueOf(trim(val.toString()));
} catch (Exception e) {
    return 0D;
doubletoDouble(Object val)
to Double
if (val instanceof Number)
    return ((Number) val).doubleValue();
if (val == null)
    return +0.0;
if (val instanceof String) {
    try {
        return Double.parseDouble((String) val);
    } catch (NumberFormatException e) {
...
DoubletoDouble(Object value)
to Double
if (value == null) {
    return new Double(0);
} else {
    return new Double(value.toString());
doubletoDouble(Object value)
to Double
if (value instanceof Number)
    return ((Number) value).doubleValue();
else if (value == null)
    return 0;
else
    return Double.parseDouble(value.toString());
DoubletoDouble(Object value)
to Double
try {
    if (value == null || EMPTY.equals(value)) {
        return null;
    return Double.valueOf(value.toString());
} catch (Exception e) {
    e.printStackTrace();
    return null;
...
DoubletoDouble(Object value)
Convert an Object to a Double.
if (value == null)
    return null;
if (value instanceof Double)
    return (Double) value;
if (value instanceof String) {
    if ("".equals((String) value))
        return null;
    return new Double((String) value);
...
DoubletoDouble(Object value)
to Double
return toDouble(value, null);
doubletoDouble(Object value, double nullValue)
to Double
if (value == null)
    return nullValue;
if (value instanceof Number)
    return ((Number) value).doubleValue();
else
    return Double.parseDouble(value.toString());
DoubletoDouble(Object x)
to Double
if (x instanceof Number) {
    return ((Number) x).doubleValue();
return Double.valueOf(x.toString());