in reply to Where's that function

You should read the sprintf to get exactly what you need, but a rough solution might be:

$x = 12.3456789; $x = $sprintf('%.2f', $x);
<kbd>--
PerlMonger::Paris(http => 'paris.pm.org');</kbd>

Replies are listed 'Best First'.
Re: Re: Where's that function
by MrNobo1024 (Hermit) on Feb 06, 2001 at 20:54 UTC
    I think you meant to say
    $x = 12.3456789; $x = sprintf('%.2f', $x);
    , right? sprintf dosen't start with a dollar sign...