Formatting currency
Posted: Tue May 17, 2005 8:27 am
Hi all.
As usual, I can usually figure my way through the tough stuff, but I seem to always fall short on the simpler things.
Basically, I am looking for the best method of formatting a positive or negative number to appear as either '$5.25' or '- $5.25' (note the space between the minus and the $).
I've looked at money format, but a) I dont want to use setlocale, and b) I cant seem to insert a space as desired. Also looked at sprintf but still to no avail.
Any help here would be hot guys. Cheers.
As usual, I can usually figure my way through the tough stuff, but I seem to always fall short on the simpler things.
Basically, I am looking for the best method of formatting a positive or negative number to appear as either '$5.25' or '- $5.25' (note the space between the minus and the $).
I've looked at money format, but a) I dont want to use setlocale, and b) I cant seem to insert a space as desired. Also looked at sprintf but still to no avail.
Any help here would be hot guys. Cheers.