|
@@ -69,17 +69,25 @@ public class JSONParser {
|
69
|
69
|
|
70
|
70
|
private static Object parseNumber(ReadableMap map, String key) {
|
71
|
71
|
try {
|
72
|
|
- return map.getInt(key);
|
|
72
|
+ Double doubleValue = map.getDouble(key);
|
|
73
|
+ if(doubleValue % 1 == 0){
|
|
74
|
+ return map.getInt(key);
|
|
75
|
+ }
|
|
76
|
+ return doubleValue;
|
73
|
77
|
} catch (Exception e) {
|
74
|
|
- return map.getDouble(key);
|
|
78
|
+ return map.getInt(key);
|
75
|
79
|
}
|
76
|
80
|
}
|
77
|
81
|
|
78
|
82
|
private static Object parseNumber(ReadableArray arr, int index) {
|
79
|
83
|
try {
|
80
|
|
- return arr.getInt(index);
|
|
84
|
+ Double doubleValue = arr.getDouble(index);
|
|
85
|
+ if(doubleValue % 1 == 0){
|
|
86
|
+ return arr.getInt(index);
|
|
87
|
+ }
|
|
88
|
+ return doubleValue;
|
81
|
89
|
} catch (Exception e) {
|
82
|
|
- return arr.getDouble(index);
|
|
90
|
+ return arr.getInt(index);
|
83
|
91
|
}
|
84
|
92
|
}
|
85
|
93
|
}
|