Mercurial > octave
diff libinterp/corefcn/pr-output.cc @ 27433:fc7504df6a12
Display "0" for true zeros rather than "0.0000" (bug #53083).
* pr-output.cc (pr_any_float): Add "else if" clause to check for 0 value and
output "0" if found.
author | Rik <rik@octave.org> |
---|---|
date | Fri, 20 Sep 2019 21:47:53 -0700 |
parents | ba3fc70ba996 |
children | 57f5c5768eb3 |
line wrap: on
line diff
--- a/libinterp/corefcn/pr-output.cc Fri Sep 20 15:22:01 2019 -0700 +++ b/libinterp/corefcn/pr-output.cc Fri Sep 20 21:47:53 2019 -0700 @@ -1360,6 +1360,15 @@ } } } + else if (val == 0) + { + octave::preserve_stream_state stream_state (os); + + if (fw > 0) + os << std::setw (fw) << "0"; + else + os << "0"; + } else if (octave::math::isna (val)) { octave::preserve_stream_state stream_state (os);