moneypunct::frac_digits
すべての小数点の右側に表示桁数のロケール固有の数を返します。
int frac_digits( ) const;
戻り値
小数点の右側に表示される桁数のロケール固有の数。
解説
このメンバー関数は do_frac_digitsを返します。
使用例
// moneypunct_frac_digits.cpp
// compile with: /EHsc
#include <locale>
#include <iostream>
#include <sstream>
using namespace std;
int main( )
{
locale loc( "german_germany" );
const moneypunct <char, true> &mpunct =
use_facet <moneypunct <char, true> >(loc);
for (unsigned int i = 0; i <mpunct.grouping( ).length( ); i++ )
{
cout << loc.name( ) << " international grouping:\n the "
<< i <<"th group to the left of the radix character "
<< "is of size " << (int)(mpunct.grouping ( )[i])
<< endl;
}
cout << loc.name( ) << " international frac_digits\n to the right"
<< " of the radix character: "
<< mpunct.frac_digits ( ) << endl << endl;
const moneypunct <char, false> &mpunct2 =
use_facet <moneypunct <char, false> >(loc);
for (unsigned int i = 0; i <mpunct2.grouping( ).length( ); i++ )
{
cout << loc.name( ) << " domestic grouping:\n the "
<< i <<"th group to the left of the radix character "
<< "is of size " << (int)(mpunct2.grouping ( )[i])
<< endl;
}
cout << loc.name( ) << " domestic frac_digits\n to the right"
<< " of the radix character: "
<< mpunct2.frac_digits ( ) << endl << endl;
}
必要条件
ヘッダー: <locale>
名前空間: std