diff options
author | Keith Packard <keithp@keithp.com> | 2019-12-18 08:49:05 -0800 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2019-12-18 20:53:36 +0100 |
commit | abcc586ffec05a7779f8474119407d050392ee18 (patch) | |
tree | e17f525a98c824f4a47755a8448cbe794f80074a /newlib/libc/stdlib | |
parent | fe512b2b12a2cea8393d14f038dc3914b1bf3f60 (diff) | |
download | newlib-abcc586ffec05a7779f8474119407d050392ee18.zip newlib-abcc586ffec05a7779f8474119407d050392ee18.tar.gz newlib-abcc586ffec05a7779f8474119407d050392ee18.tar.bz2 |
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>
Diffstat (limited to 'newlib/libc/stdlib')
-rw-r--r-- | newlib/libc/stdlib/ecvtbuf.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/newlib/libc/stdlib/ecvtbuf.c b/newlib/libc/stdlib/ecvtbuf.c index e3d7b55..12e8c9a 100644 --- a/newlib/libc/stdlib/ecvtbuf.c +++ b/newlib/libc/stdlib/ecvtbuf.c @@ -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 */ |