Monday, March 3, 2008

Commas in Ext Currency Format

I'm using the fabulous Ext Javascript library through ColdFusion 8. It outputs a beautiful, full-featured grid complete with sorting and re-ordering of columns.

It has a US currency formatter called the usMoney Format Renderer but it lacks the all-too-useful comma separator when dealing with numbers greater than 999. Ext, did you think we were only small-time?

So i swapped out the current usmoney function in the util.js with this one. The math seems to work out but if you catch anything let me know.