if ( NumericTrue( $cost ) ) { ... } sub NumericTrue{ return shift()*1.0; }