#include <iostream>
#include <locale>
#include <string>
using namespace std;
int main( ) {
locale loc(""); // Create a copy of the user's locale
cout << "Locale name = " << loc.name( ) << endl;
cout.imbue(loc); // Tell cout to use the formatting of
// the user's locale
cout << "pi in locale " << cout.getloc( ).name( ) << " is "
<< 3.14 << endl;
}
|