Unverified Commit 2fa63a13 authored by Lukáš Voborský's avatar Lukáš Voborský Committed by GitHub
Browse files

Fix of string.format("%.0f") (#3199)


Co-authored-by: default avatarvsky <blue205@centrum.cz>
parent 95f5191c
......@@ -642,6 +642,9 @@ vsprintf (char *d, const char *s, va_list ap)
//static void dtoa (char *, double, int, int, int);
void dtoa (char *dbuf, rtype arg, int fmtch, int width, int prec);
dbl = va_arg(ap, double);
if (!haddot) {
trunc = 6;
}
dtoa(d, dbl, *s, width, trunc);
trunc = 0;
}
......@@ -763,9 +766,7 @@ void dtoa (char *dbuf, rtype arg, int fmtch, int width, int prec)
return;
}
if (prec == 0)
prec = 6;
else if (prec > MAX_FRACT)
if (prec > MAX_FRACT)
prec = MAX_FRACT;
/* leave room for sign at start of buffer */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment