Apache C++ Standard Library User's Guide

## 28.4 Localization Using the Stream's Locale

Associated with each stream is a locale object that impacts the parsing and formatting of numeric values, and determines the code conversion, if any, which takes place when transfering text between external and internal representation. This is how localization of software takes place. As discussed in Section 23.2.2, the representation of numbers often depends on cultural conventions. In particular, the decimal point need not be a period, as in the following example:

    std::cout.imbue(std::locale("De_DE"));    // the actual locale name
                                              // may vary
    std::cout << 1000000.50 << std::endl;

The output is:

    1000000,50

Other cultural conventions, like the grouping of digits, are irrelevant. There is no formatting of numeric values that involves grouping. (The standard does not specify whether the grouping information that is contained in a stream's locale's `numpunct` facet should be ignored or taken into account. In any case, there are no manipulators that allow you to enable or disable grouping.)