Android String to Double Convert toDouble(String s)

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

Description

to Double

Declaration

public static double toDouble(String s) 

Method Source Code

//package com.java2s;

public class Main {
    public static double toDouble(String s) {
        double i = 0;
        try {//from  w  w w  . j av  a 2 s . c om
            i = Double.parseDouble(s);
        } catch (Exception e) {
            i = -1;
        }
        return i;
    }
}

Related

  1. getDouble(String str, double defaultValue)
  2. getDoubleFromStr(String str)
  3. getDoubleValue(String value)
  4. parseDistance(double distance)
  5. parseDouble(String string, double defValue)