diff --git a/json_parser.c b/json_parser.c index 30dd0f7..4b0e089 100644 --- a/json_parser.c +++ b/json_parser.c @@ -345,6 +345,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) {