The following code
if (Double.parseDouble(value) > 0)
throws the following exception
java.lang.NumberFormatException: Invalid double: "-2.49"
The logged value seems like a valid Double, what might cause this exception?
The following code
if (Double.parseDouble(value) > 0)
throws the following exception
java.lang.NumberFormatException: Invalid double: "-2.49"
The logged value seems like a valid Double, what might cause this exception?
You seem to encounter a locale issue. That is, integer and fractional part separators differ in different locales, somewhere it's
.
and somewhere,
.See that question, there's a probable solution. Use the locale which fits the best for you, for example
Locale.US
uses.
as the separator.