Fix fcvt to only show 'ndigit' past decimal
Even if the number is really small and this means showing *no* digits. This makes newlib match glibc, and the fcvt posix man page. Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
85a3a81837
commit
233c16aa61
|
@ -235,14 +235,7 @@ fcvtbuf (double invalue,
|
|||
|
||||
save = fcvt_buf;
|
||||
|
||||
if (invalue < 1.0 && invalue > -1.0)
|
||||
{
|
||||
p = _dtoa_r (reent, invalue, 2, ndigit, decpt, sign, &end);
|
||||
}
|
||||
else
|
||||
{
|
||||
p = _dtoa_r (reent, invalue, 3, ndigit, decpt, sign, &end);
|
||||
}
|
||||
p = _dtoa_r (reent, invalue, 3, ndigit, decpt, sign, &end);
|
||||
|
||||
/* Now copy */
|
||||
|
||||
|
|
Loading…
Reference in New Issue