Android examples for java.lang:Double
Parse object to decimal
import android.annotation.SuppressLint; import java.text.SimpleDateFormat; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main{ public static boolean decimal(Object o) { double n = 0; try {//from ww w . ja v a2 s . c o m n = Double.parseDouble(o.toString().trim()); } catch (NumberFormatException e) { e.printStackTrace(); } if (n > 0.0) { return true; } else { return false; } } }