in reply to Re: Rounding to a Given Number of Significant Figures Rather Than Decimal Places
in thread Rounding to a Given Number of Significant Figures Rather Than Decimal Places

Drop the zero in the format.

Update: Urm... that will replace the leading zero with a space, which is only part of your problem... Apparently, the default precision offered by "%g" is smaller than the precision you desire.

OK, try this:

$_ = 1298.844667; my $clem = sprintf("%.7g", $_); print "$clem\n";
Result:
1298.845
OK?