fltfmt: %.0g should print with one significant figure

This commit is contained in:
ppatience0 2013-03-03 13:21:17 -05:00
parent 3d908529e9
commit 1a88844069

View file

@ -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;