Bishma has asked for the wisdom of the Perl Monks concerning the following question:
I have a string of numbers I read in from a file. This number is getting very long (into the billons) and it's had to read when it's sent to output. I'd like to be able to set up commas in it.
In otherwords, I'd like 87654321 to be displayed as 87,654,321 without changeing the info stored in the file.
Is there a simple way to do this with printf or something, or could someone come up with a good way to alter it before being printed to the screen? This number is constantly being altered (by millions at a time usually) by other scripts.
|