in reply to Deleting trailing 0's after using sprintf

The g flag excises trailing zeros:
my $pct = 10.300; $pct = sprintf "%.3g", $pct; print "$pct\n"; __OUTPUT__ 10.3

-Mark