more useful options | |
PerlMonks |
Re^5: number comparison with a twistby pryrt (Abbot) |
on Mar 02, 2020 at 16:10 UTC ( [id://11113647]=note: print w/replies, xml ) | Need Help?? |
A quibble: truncating is the wrong thing to do, and is the problem with your original int() solution in the first place. Rounding to the nearest cent is the right thing to do (which can be done through round() as I suggested, or using the sprintf() solutions that others have mentioned).
In Section
Seekers of Perl Wisdom
|
|