Java tutorial
//package com.java2s; //License from project: Open Source License import android.util.Log; public class Main { public static double getDoubleFromString(String number) { if (number.length() <= 0) { return 0; } else { try { double num = Double.parseDouble(number); return num; } catch (Exception ex) { Log.e("Helper", ex.getMessage()); return 0; } } } }