Created
October 18, 2018 01:56
-
-
Save tucomel/29bb273895ec9d9dc2309ad6af8662e0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param str String with special caracters | |
* @return double value of string | |
*/ | |
public static double toDouble(String str) { | |
str = str.replaceAll("[^\\d]", ""); | |
if (str != null && str.length() > 0) { | |
return Double.parseDouble(str) / 100; | |
} else { | |
return 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment