Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion quickjs.c
Original file line number Diff line number Diff line change
Expand Up @@ -11351,6 +11351,7 @@ static int js_ecvt(double d, int n_digits,
}
} else {
#if defined(FE_DOWNWARD) && defined(FE_TONEAREST)
int i;
/* generate 2 extra digits: 99% chances to avoid 2 calls */
js_ecvt1(d, n_digits + 2, dest, size, decpt);
if (dest[n_digits + 1] < '5')
Expand All @@ -11364,7 +11365,7 @@ static int js_ecvt(double d, int n_digits,
return n_digits; /* truncate the 2 extra digits */
}
/* round up in the string */
for(int i = n_digits;; i--) {
for(i = n_digits;; i--) {
/* ignore the locale specific decimal point */
if (is_digit(dest[i])) {
if (dest[i]++ < '9')
Expand Down