Is there a good way to do printf's with currency symbols?

I've tried this:

  printf "Total: \$%10.2f\n", $total;

But it puts the dollar sign way out front (ugly).  I want it to look like:

  Total:    $24.15

Is there a way to do this without getting all messy like this?

  printf "Total:%10s\n", "\$".sprintf(%.2f,$total);

- Bryan



-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to