It has been a while since there has been a good round of golf, so I decided to post one. I couldn't come up with a nice interesting math brainteaser, so I'll post this one.
The Rules Write a sub that takes a number as an argument and returns it in the standard monetary format  with comma's and to two decimal places
Expected InputOutput
 Input: 3
 Output: 3.00
 Input: 1000
 Output: 1,000.00
 Input: 12345678
 Output: 12,345,678.00
 Input: 4444444.11
 Output: 4,444,444.11
 Input: 98765.343
 Output: 98,765.34
 Input: 111.229
 Output: 111.23
My Swing (83 chars)

Enoch
(update: Changed "integer" to "number". Integers don't have decimals. Thanks to xylus for pointing out my err.
Back to
Meditations