From 1a8884406906d6b9e6fddffb609efa8b924939e7 Mon Sep 17 00:00:00 2001 From: ppatience0 Date: Sun, 3 Mar 2013 13:21:17 -0500 Subject: fltfmt: %.0g should print with one significant figure --- sys/src/libc/fmt/fltfmt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/src/libc/fmt/fltfmt.c b/sys/src/libc/fmt/fltfmt.c index 84bd0c91c..aed8d9518 100644 --- a/sys/src/libc/fmt/fltfmt.c +++ b/sys/src/libc/fmt/fltfmt.c @@ -187,7 +187,7 @@ found: * c3 digits of trailing '0' * c4 digits after '.' */ - if(chr == 'g') /* Significant figures. */ + if(chr == 'g' && prec > 0) /* Significant figures. */ prec--; c1 = 0; c2 = prec + 1; -- cgit v1.2.3