and1.5000 -> $1.50 1.5050 -> $1.50 1.5051 -> $1.51
1.5100 -> $1.51 1.5150 -> $1.52
Edit: Adding a list of relevant links that may be of interest.
sub monetize { require Math::BigFloat; #Defaults to a real $USD amount, rounding to nearest penny Math::BigFloat->new($_[0])->ffround( $_[1] || -2 ); }
In reply to Proper monetary rounding by blogical
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |