Name

numpunct class template — Facet for punctuation of numbers

Synopsis

template <typename charT>
class numpunct : public locale::facet
{
public:
  typedef charT char_type;
  typedef basic_string<charT> string_type;
  explicit numpunct(size_t refs = 0);
  char_type decimal_point(  ) const;
  char_type thousands_sep(  ) const;
  string grouping(  ) const;
  string_type truename(  ) const;
  string_type falsename(  ) const;
  static locale::id id;
protected:
  virtual ~numpunct(  );
  virtual char_type do_decimal_point(  ) const;
  virtual char_type do_thousands_sep(  ) const;
  virtual string do_grouping(  ) const;
  virtual string_type do_truename(  ) const;
  virtual string_type do_falsename(  ) const;
};

The numpunct class template is a facet for numeric formatting and punctuation. The num_get and num_put facets use numpunct. The numpunct<char> and numpunct<wchar_t> instantiations are standard.

As with other facets, the public members call virtual, protected members with the same name prefaced by do_. Thus, to use the facet, call the public functions, such as grouping, which calls do_grouping. The descriptions below are for the virtual functions because they do the real work. Imagine that for each virtual-function description, there is a corresponding description for a public, nonvirtual function, such as:

The following are the virtual, protected members of numpunct: