Looks like Number::Format would be an easy way to go. I haven't used it myself, but by my reading of the documentation, it would be as simple as:
use Number::Format ':subs'; for (qw($100000000.00 $100.00 $1000.00)) { s/^\$//; $_ = '$' . format_number( $_, 2, 2 ); print; }
It's even easier if there weren't the dollar sign at the front.
In reply to Re: formatting numbers
by kyle
in thread formatting numbers
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |