in reply to Re: Integer vs Float during addition
in thread Integer vs Float during addition

One way to do that is:
if ( NumericTrue( $cost ) ) { ... } sub NumericTrue{ return shift()*1.0; }
(Updated to allow e.g. 99 cents to be a cost.)

-M

Free your mind

Replies are listed 'Best First'.
Re^3: Integer vs Float during addition
by ikegami (Patriarch) on Jun 30, 2006 at 06:15 UTC
    Or return 0+shift();