locale loc("") ;
The line
const moneypunct <char, true> &mpunct = use_facet <moneypunct <char, true > >(loc) ;creates an object mpunct which is a reference to a moneypunct template class. This has information about the specified locale - in our case the thousands_sep() method returns the character used for thousands separator.
Without the line
cout.imbue( loc ) ;There would be no thousand's separators. Try commenting it out and rerunning the program.
Note There seem to be discrepancies between different compilers as to how cout.imbue behaves. Under Visual C++ 2005 Express Edition, this included separators. But the same code with Microsoft Visual C++ 6.0 did not!
Decimal Points
The example on the previous page used showpoint to show trailing zeros after the decimal points. It output numbers in what is called standard mode. Other modes include- Fixed Mode - Show numbers like 567.8
- Scientific Mode - Show numbers like 1.23450e+009
On the Next Page - Some Things to Watch out for

