Java - Write code to convert String To Double

Requirements

Write code to convert String To Double

Demo

//package com.book2s;

public class Main {
    public static void main(String[] argv) {
        String sMt = "123123.123";
        System.out.println(convertStringToDouble(sMt));
    }//ww w .  ja v a  2s . c om

    public synchronized static double convertStringToDouble(String sMt) {
        double result = 0;
        try {
            result = Double.valueOf(sMt).doubleValue();
        } catch (Exception e) {

        }
        return result;
    }
}