Skip to content

Commit 425f0df

Browse files
committed
Fix bug with JSON parser
1 parent fec4958 commit 425f0df

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

res/plugin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: RedLib
22
main: redempt.redlib.RedLib
3-
version: 2022-08-18 18:37
3+
version: 2022-09-04 18:38
44
author: Redempt
55
api-version: 1.13
66
load: STARTUP

src/redempt/redlib/json/JSONParser.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,9 @@ private long integer() {
7575

7676
private double decimal(long first) {
7777
assertChar('.');
78+
int start = pos;
7879
long second = integer();
79-
double decimal = second * Math.pow(0.1, Math.ceil(Math.log10(second)));
80+
double decimal = second * Math.pow(0.1, pos - start);
8081
return first < 0 ? first - decimal : decimal + first;
8182
}
8283

0 commit comments

Comments
 (0)