Nope, there is not a simple function to do this. You have to look around for someone else's code. I'd bet there's a lot of code out there, I have some C++ code that does currency. But your request is not a simple request.
Thanks for your responses, guys - i figured maybe i'd forgotten a specifier, however to make myself a bit clearer, maschwa i don't actually know what the output is going to be... sorry, i should have said 999,999,999 was just an example of some numeric output - i didn't want to re-invent the wheel if there was a way of putting the commas in the right place automatically.
jtm111, do you know if your currency code converter will work with c as well as c++?
otherwise i guess i can split it using awk or something.
now the parameters are a double value but no bigger than 42,000,000 (million); and a int value which determins if you want to print to the display or to file.
function call...
printf(" In currency 41521213.12 is "
monetary value(41521213.12, 1); /* this will print 41,521,213.12 to the display. Hoping to get certified..in C programming.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.