%E-like %g and %G conversions should remove trailing zeroes unless

the # flag is present.  Implement this behavior and add a comment
describing it.

Noticed by:	Enache Adrian <enache@rdslink.ro>
Pointy hat to:	das
This commit is contained in:
das 2003-04-19 23:53:19 +00:00
parent dc48d3db81
commit 30c051657a
2 changed files with 14 additions and 0 deletions

View File

@ -920,6 +920,13 @@ reswitch: switch (ch) {
prec = ndig - expt;
if (prec < 0)
prec = 0;
} else {
/*
* Make %[gG] smell like %[eE], but
* trim trailing zeroes if no # flag.
*/
if (!(flags & ALT))
prec = ndig;
}
}
if (expchar) {

View File

@ -889,6 +889,13 @@ reswitch: switch (ch) {
prec = ndig - expt;
if (prec < 0)
prec = 0;
} else {
/*
* Make %[gG] smell like %[eE], but
* trim trailing zeroes if no # flag.
*/
if (!(flags & ALT))
prec = ndig;
}
}
if (expchar) {