Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
2fa63a13
Unverified
Commit
2fa63a13
authored
Jul 07, 2020
by
Lukáš Voborský
Committed by
GitHub
Jul 07, 2020
Browse files
Fix of string.format("%.0f") (#3199)
Co-authored-by:
vsky
<
blue205@centrum.cz
>
parent
95f5191c
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/libc/stdio.c
View file @
2fa63a13
...
...
@@ -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 */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment