mirror of
https://github.com/fankes/JSON-java-compat.git
synced 2025-09-06 18:55:30 +08:00
fixes error in -0 check
This commit is contained in:
@@ -1502,7 +1502,7 @@ public class JSONObject {
|
|||||||
try {
|
try {
|
||||||
if (string.indexOf('.') > -1 || string.indexOf('e') > -1
|
if (string.indexOf('.') > -1 || string.indexOf('e') > -1
|
||||||
|| string.indexOf('E') > -1
|
|| string.indexOf('E') > -1
|
||||||
|| "0".equals(string.substring(1))) {
|
|| "-0".equals(string)) {
|
||||||
d = Double.valueOf(string);
|
d = Double.valueOf(string);
|
||||||
if (!d.isInfinite() && !d.isNaN()) {
|
if (!d.isInfinite() && !d.isNaN()) {
|
||||||
return d;
|
return d;
|
||||||
|
Reference in New Issue
Block a user