ref: 1a8884406906d6b9e6fddffb609efa8b924939e7
parent: 3d908529e9f209be066b56be817f724a7b89d9c4
author: ppatience0 <ppatience0@gmail.com>
date: Sun Mar 3 08:21:17 EST 2013
fltfmt: %.0g should print with one significant figure
--- a/sys/src/libc/fmt/fltfmt.c
+++ b/sys/src/libc/fmt/fltfmt.c
@@ -187,7 +187,7 @@
* 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;
--
⑨