For scientific applications requiring the use of significant
figures ("sig figs"), I strongly recommend the
Math::SigFigs module. Unfortunately, the
CPAN testers still haven't cleared it for Windows
clients, though...
use Math::SigFigs;
print FormatSigFigs($number, $digits);