名前空間
変種
操作

std::moneypunct::thousands_sep, std::moneypunct::do_thousands_sep

提供: cppreference.com
< cpp‎ | locale‎ | moneypunct

 
 
ローカライゼーションライブラリ
ロケールおよびファセット
Original:
Locales and facets
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
locale
文字分類
Original:
Character classification
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
変換
Original:
Conversions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ファセットカテゴリの基底クラスです
Original:
Facet category base classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ファセットカテゴリ
Original:
Facet categories
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ロケール固有のファセット
Original:
Locale-specific facets
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
コー​​ド変換ファセット
Original:
Code conversion facets
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
codecvt_utf8(C++11)
codecvt_utf16(C++11)
Cロケール
Original:
C locale
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
 
 
Defined in header <locale>
public:
char_type thousands_sep() const;
(1)
protected:
char_type virtual do_thousands_sep() const;
(2)
1)
パブリックメンバ関数は、最派生クラスのメンバ関数を呼び出しdo_thousands_sep.
Original:
public member function, calls the member function do_thousands_sep of the most derived class.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
貨幣価値の不可分の一部を解析したり、書式設定桁のグループ間の区切り文字として使用する文字を返します。.
Original:
returns the character to be used as the separator between digit groups when parsing or formatting the integral parts of monetary values.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] 値を返します

桁区切り記号として使用する型char_typeのオブジェクト。 std::moneypunctリターンの標準スペシャ’,’L’,’.
Original:
The object of type char_type to use as the thousands separator. The standard specializations of std::moneypunct return ’,’ and L’,’.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集]

#include <locale>
#include <iostream>
#include <iomanip>
#include <iterator>
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';
}

Output:

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

[編集] も参照してください

[仮想]
桁区切りの各ペア間の数字の番号を提供します
Original:
provides the numbers of digits between each pair of thousands separators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(仮想protectedメンバ関数)