Namespaces
Variants

std::moneypunct<CharT,International>:: thousands_sep, do_thousands_sep

From cppreference.net
ヘッダーで定義 <locale>
public :
char_type thousands_sep ( ) const ;
(1)
protected :
virtual char_type do_thousands_sep ( ) const ;
(2)
1) 公開メンバ関数。最も派生したクラスのメンバ関数 do_thousands_sep を呼び出します。
2) 通貨値の整数部分を解析または書式設定する際に、数字グループの区切り文字として使用される文字を返します。

戻り値

千の位の区切り文字として使用する char_type 型のオブジェクト。一般的な米国ロケールでは、これは ',' または L ',' です。

#include <iomanip>
#include <iostream>
#include <iterator>
#include <locale>
struct space_out : std::moneypunct<char>
{
    pattern do_pos_format() const { return {value, none, none, none}; }
    int do_frac_digits() const { return 0; }
    char_type do_thousands_sep() const { return ' '; }
    string_type do_grouping() const { return "\002"; }
};
int main()
{
    std::cout.imbue(std::locale("en_US.UTF-8"));
    std::cout << "american locale: " << std::showbase
              << std::put_money(12345678.0) << '\n';
    std::cout.imbue(std::locale(std::cout.getloc(), new space_out));
    std::cout << "locale with modified moneypunct: "
              << std::put_money(12345678.0) << '\n';
}

出力:

american locale: $123,456.78
locale with modified moneypunct: 12 34 56 78

関連項目

[virtual]
各桁区切り文字の間の桁数を提供する
(仮想保護メンバー関数)