shithub: riscv

Download patch

ref: 95d41e8ff4fb5a282e7cf55c4fa82eeb1950eb63
parent: 1a8884406906d6b9e6fddffb609efa8b924939e7
author: ppatience0 <[email protected]>
date: Sun Mar 3 09:12:33 EST 2013

fltfmt: make %g print decimal numbers less than 1 with a leading zero

--- a/sys/src/libc/fmt/fltfmt.c
+++ b/sys/src/libc/fmt/fltfmt.c
@@ -205,7 +205,7 @@
 		if(xadd(s1, c2, 5))
 			e++;
 		if(e >= -4 && e <= prec) {
-			c1 = -e - 1;
+			c1 = -e;
 			c4 = prec - e;
 			chr = 'h';	// flag for 'f' style
 		}