%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:
parent
dc48d3db81
commit
30c051657a
@ -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) {
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user