Here you can find the source of toDouble(final String value)
Parameter | Description |
---|---|
value | the value |
public static double toDouble(final String value)
//package com.java2s; //License from project: Apache License public class Main { /**//w ww. j av a 2s . c o m * To double. * * @param value the value * @return the double */ public static double toDouble(final String value) { if (value == null) { return 0.0D; } String szTemp = ""; for (int i = 0; i < value.length(); i++) if (value.charAt(i) != ',') { szTemp = szTemp + value.charAt(i); } try { final double d = Double.parseDouble(szTemp); return d; } catch (final NumberFormatException e) { final double d1 = 0.0D; return d1; } } }