when using #include <iomanip> ; what is the syntax for formating numerical values for currency - example 123456, format to $123,456. Using the cout << command.
dallin
0
Newbie Poster
Recommended Answers
Jump to PostC++ doesn't have native support for working with monetary values. You need to either find a library that does what you want, or roll your own:
#include <iomanip> #include <iostream> #include <sstream> #include <string> using namespace std; string currency ( double value ) { ostringstream sout; sout<< …
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.