Java tutorial
//package com.java2s; //License from project: Apache License public class Main { private static Double transformToDouble(String v) { if (v != null) { try { return Double.valueOf(v); } catch (NumberFormatException e) { return (double) 0; } } else { return (double) 0; } } }