in reply to How to give format to numbers?

As mentioned, sprintf/printf may suit your needs.

Another option is Number::Format, which will do all that, and a lot more.