共用方式為


numpunct::grouping

傳回決定的數字如何與地區設定專用規則在任何小數點左邊的群組。

string grouping( ) const;

傳回值

判斷的數字如何與地區設定專用規則在任何小數點左邊的群組。

備註

成員函式會傳回 do_grouping

範例

// numpunct_grouping.cpp
// compile with: /EHsc
#include <locale>
#include <iostream>
#include <sstream>
using namespace std;
int main( )
{
   locale loc( "german_germany");

   const numpunct <char> &npunct = 
       use_facet < numpunct <char> >( loc );
   for (unsigned int i = 0; i < npunct.grouping( ).length( ); i++)
   {
      cout << loc.name( ) << " international grouping:\n the "
           << i <<"th group to the left of the radix character "
           << "is of size " << (int)(npunct.grouping ( )[i]) 
           << endl;
   }
}
  

需求

標題: <地區設定>

命名空間: std

請參閱

參考

numpunct 類別