Writing and Reading Numbers - C++ Internationalization

C++ examples for Internationalization:Locale

Description

Writing and Reading Numbers

Demo Code

#include <iostream>
#include <locale>
#include <string>

using namespace std;

int main() {/*w w w .j  a  v  a 2  s .c o m*/
   locale loc(""); 
   cout << "Locale name = " << loc.name() << endl;

   cout.imbue(loc); 

   cout << "pi in locale " << cout.getloc().name() << " is " << 3.14 << endl;
}

Result


Related Tutorials