Java Double Number Create toDouble(String s)

Here you can find the source of toDouble(String s)

Description

to Double

License

Open Source License

Declaration

public static double toDouble(String s) 

Method Source Code

//package com.java2s;

public class Main {
    public static double toDouble(String s) {
        if ((s != null) && (!("".equals(s.trim()))))
            return Double.parseDouble(s);

        return 0.0D;
    }/*from  w w  w .  ja v  a2 s. co m*/

    public static boolean equals(String s1, String s2) {
        if ((isEmpty(s1)) && (isEmpty(s2)))
            return true;
        if ((!(isEmpty(s1))) && (!(isEmpty(s2))))
            return s1.equals(s2);

        return false;
    }

    public static boolean isEmpty(String s) {
        return ((s == null) || ("".equals(s)));
    }

    public static String isEmpty(String s, String result) {
        if ((s != null) && (!(s.equals(""))))
            return s;

        return result;
    }
}

Related

  1. toDouble(String doubleString, Double defaultValue)
  2. toDouble(String input, double defaultValue)
  3. toDouble(String parameter)
  4. toDouble(String s)
  5. toDouble(String s)
  6. toDouble(String s)
  7. toDouble(String str)
  8. toDouble(String str)
  9. toDouble(String str)