On Feb 8, FLAHERTY, JIM-CONT said:

>some times comes up with   24.999997  . I would like to round or trim to
>24.99 for example .  any Ideas  ??

  perldoc -q round

will tell you about whether or not Perl has a rounding function.

If you're REALLY worried about whether 12.345 rounds to 12.34 or 12.35,
then you should use a specific rounding function, but if not, you can use
sprintf():

  $num = sprintf "%.02f", $raw;

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to