diff --git a/src/util/json_parser.c b/src/util/json_parser.c index 9b379c86..65e9cba0 100644 --- a/src/util/json_parser.c +++ b/src/util/json_parser.c @@ -363,6 +363,23 @@ static double __evaluate_json_number(const char *integer, figures++; } + if (exp != 0 && figures != 0) + { + while (exp > 0 && figures < 18) + { + mant *= 10; + exp--; + figures++; + } + + while (exp < 0 && mant % 10 == 0) + { + mant /= 10; + exp++; + figures--; + } + } + num = mant; if (exp != 0 && figures != 0) {