There is a module for that, namely Number::Format. And (shameless self advertise) itīs extension Number::Format::Calc, with wich you can do calculations with commifies numbers.
holli, /regexed monk/
Comment on Re: Commify numbers, the boring and straightforward way
That is neat. However, unless I actually need the flexibility that module provides, I don't think saving 6 or 7 lines of code is worth an added dependency. That sort of issue crops up with other only nearly trivial stuff like a file slurping function too.