共用方式為


numpunct::grouping

Returns a locale-specific rule for determining how digits are grouped to the left of any decimal point.

string grouping( ) const;

Return Value

A locale-specific rule for determining how digits are grouped to the left of any decimal point.

Remarks

The member function returns do_grouping.

Example

// 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;
   }
}
German_Germany.1252 international grouping:
 the 0th group to the left of the radix character is of size 3

Requirements

Header: <locale>

Namespace: std

See Also

Reference

numpunct Class

Other Resources

numpunct Members