in reply to Formatting numbers with commas

I think the reason for this is that in some circumstances you use a comma as a thousand separator, while in other circumstances the single apostrophe is used. Yes, even the single dot may be used for this. (Together with a comma to indicate the beginning of fractions.)

So implementing this in sprintf() might become rather messy. Implementing it as your own sub() means that you can do it the way you need in your particular situation.

And, as already mentioned above, there are many examples available of how to do it. If you do not yet have access to The Perl Cookbook then I advice you to get it. It's very useful.


Everything went worng, just as foreseen.