07.09.2011, 08:26
There could be an easier way, but i think you could use a classy way of calculating using modulus (%) and division for the ones, tens and hundreds by doing value % 1000, thousands, ten thousands and hundred thousands by floor rounding the result of value / 1000, and so on. Then just use format for each break, and calculate cents.. not sure how you would like that done but thats how I would do it. Could take a little bit of tweaking initially but yeah.