Need to format currency using C
Posted on 2000-03-28
I need you to write me a C function that receives as input a FLOAT called "money" and prints out (printf)the money ammount in the format $XXX,XXX,XXX,XXX.XX
you should assume that "money <= 999999999999.99". I also need the dollar sign to trail in front of the amount with only 1 space between the sign and the amount.
Please note that i do not want the dollar sign in a fixed position, it should trail in front of the amount. For example, if "money = 200000.99" the output of the function should be "$ 200,000.00" and not "$ , ,200,000.00"
the output is just a printf.