Skip to content

Commit

Permalink
<Libc>Add-support-for-scanf-accept-formatted-input
Browse files Browse the repository at this point in the history
Optimize printf for fractional point of floating point value

Issue: #225
  • Loading branch information
sagarladla committed Jun 28, 2024
1 parent f213b3a commit b745155
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/libc/printf.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,10 @@ static int fltprint(const FILE *dev, bool en_stdout, double flt,
{
frac *= 10.0;
padf--;
d = (long) frac;
if (!d)
__fputc(dev, en_stdout, '0');
}
d = (long) frac;
ret += unumprint(dev, en_stdout, d,10, '0', 0);

return ret;
Expand Down

0 comments on commit b745155

Please sign in to comment.