#include <iostream>
#include <locale>
using namespace std;
int main()
{
    const int mega = 1'000'000;
    locale systemLocale("");
    cout.imbue(systemLocale);
    cout << "System's locale: " << mega << endl;
}
One side note about creating std::locale object. It can be done in many ways, but it is worth to know about three basic ones:
- with the default constructor, "C" locale is created
- with single string parameter (const char* or std::string), locale corresponding to given name is created
- with a single, empty string parameter, system's default locale object is created.
System's locale: 1000000System's locale: 1á000á000[System.Console]::OutputEncoding = [System.Text.Encoding]::Default