Convert string to Double - Android java.lang

Android examples for java.lang:Double

Description

Convert string to Double

Demo Code

import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main{

    public static double getDouble(String text) {
        try {/*from w w w  .jav  a  2  s .  c o  m*/
            return Double.valueOf(text);
        } catch (Exception e) {

        }
        return 0;
    }

}

Related Tutorials