fork(16) download
  1. #include <iostream>
  2. #include <sstream>
  3. // Include the std::put_money and other utilities
  4. #include <iomanip>
  5.  
  6. int main(int argc, char **argv)
  7. {
  8. // Value in cents!
  9. const int basepay = 10000;
  10. std::stringstream ss;
  11.  
  12. // Sets the local configuration
  13. ss.imbue(std::locale(""));
  14. ss << std::showbase << std::put_money(basepay);
  15.  
  16. std::cout << std::locale("").name() << ": " << ss.str() << '\n';
  17.  
  18. return 0;
  19. }
Success #stdin #stdout 0s 4516KB
stdin
Standard input is empty
stdout
en_US.UTF-8: $100.00