From 24ea306fa66c77739d4c35c892bdf1283f51bb33 Mon Sep 17 00:00:00 2001 From: ppatience0 Date: Wed, 27 Feb 2013 16:15:18 -0500 Subject: fltfmt: %.ng is supposed to print a number with n significant figures, but it prints it with n+1. This fixes that behaviour. --- sys/src/libc/fmt/fltfmt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/src/libc/fmt/fltfmt.c b/sys/src/libc/fmt/fltfmt.c index ff5462910..a00a6b14a 100644 --- a/sys/src/libc/fmt/fltfmt.c +++ b/sys/src/libc/fmt/fltfmt.c @@ -187,6 +187,8 @@ found: * c3 digits of trailing '0' * c4 digits after '.' */ + if(chr == 'g') /* Significant figures. */ + prec--; c1 = 0; c2 = prec + 1; c3 = 0; -- cgit v1.2.3