in reply to Re: Re: 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
and the number 1298.844667 as input, I get the output 01298.84 and not 1298.845, which is what I want.$_ = FormatSigFigs($_,8); my $clem = sprintf("%08g", $_); print "$clem\n";
Edit: larsen. Added <code> tags and some minor formatting.
|
---|