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 authored and akashkollipara committed Jun 29, 2024
1 parent 2054ffa commit 645063c
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 645063c

Please sign in to comment.