in reply to Re^2: Proper monetary rounding
in thread Proper monetary rounding
I think he's saying that sprintf actually does that, in just that way:
perl -e 'my $x = 1.5050; my $y = 1.5150; my $s = sprintf "%0.2f\n%0.2f
+\n", $x, $y; print $s;'
"Normal" (gradeschool) rounding would produce 1.51 and 1.52 there, but
sprintf says 1.50 and 1.52, which seems an aweful lot like round-to-even
to me. How does it differ from what you wanted?
As far as accountants being picky about this... have you ever seen
the movie Superman 3?