---
name: "std::numpunct_byname"
section: "3"
platform: "linux"
package: "gcc"
version: "16.2.1+r23+gd564253eb6c8-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/std::numpunct_byname"
---

# std::numpunct\_byname(3)

class numpunct\_byname \[22.2.3.2\].

## NAME

std::numpunct\_byname\< \_CharT \> - class numpunct\_byname \[22.2.3.2\].

## SYNOPSIS

\#include \<locale\>

Inherits **std::numpunct\< \_CharT \>**.

### Public Types

typedef \_\_numpunct\_cache\< \_CharT \> **\_\_cache\_type**\
 typedef \_CharT **char\_type**\
 typedef **basic\_string**\< \_CharT \> **string\_type**\

### Public Member Functions

**numpunct\_byname** (const char \*\_\_s, size\_t \_\_refs=0)\
 **numpunct\_byname** (const **string** &\_\_s, size\_t \_\_refs=0)\
 char\_type **decimal\_point** () const\
 Return decimal point character.  string\_type **falsename** () const\
 Return string representation of bool false.  **string** **grouping** () const\
 Return grouping specification.  char\_type **thousands\_sep** () const\
 Return thousands separator character.  string\_type **truename** () const\
 Return string representation of bool true.

### Static Public Attributes

static **locale::id** **id**\
 Numpunct facet id.

### Protected Member Functions

void **\_M\_initialize\_numpunct** (\_\_c\_locale \_\_cloc)\
 void **\_M\_initialize\_numpunct** (\_\_c\_locale \_\_cloc)\
 void **\_M\_initialize\_numpunct** (\_\_c\_locale \_\_cloc=0)\
 virtual char\_type **do\_decimal\_point** () const\
 Return decimal point character.  virtual string\_type **do\_falsename** () const\
 Return string representation of bool false.  virtual **string** **do\_grouping** () const\
 Return grouping specification.  virtual char\_type **do\_thousands\_sep** () const\
 Return thousands separator character.  virtual string\_type **do\_truename** () const\
 Return string representation of bool true.

### Static Protected Member Functions

static \_\_c\_locale **\_S\_clone\_c\_locale** (\_\_c\_locale &\_\_cloc)  throw ()\
 static void **\_S\_create\_c\_locale** (\_\_c\_locale &\_\_cloc, const char \*\_\_s, \_\_c\_locale \_\_old=0)\
 static void **\_S\_destroy\_c\_locale** (\_\_c\_locale &\_\_cloc)\
 static \_\_c\_locale **\_S\_get\_c\_locale** ()\
 static const char \* **\_S\_get\_c\_name** ()  throw ()\
 static \_\_c\_locale **\_S\_lc\_ctype\_c\_locale** (\_\_c\_locale \_\_cloc, const char \*\_\_s)\

### Protected Attributes

\_\_cache\_type \* **\_M\_data**\

## Detailed Description

### template\<typename \_CharT\>

class std::numpunct\_byname\< \_CharT \>"class numpunct\_byname \[22.2.3.2\].

## Member Function Documentation

### template\<typename \_CharT\> char\_type std::numpunct\< \_CharT \>::decimal\_point () const \[inline\], \[inherited\]

Return decimal point character. This function returns a char\_type to use as a decimal point. It does so by returning returning numpunct\<char\_type\>::do\_decimal\_point().

**Returns**

*char\_type* representing a decimal point.

References **do\_decimal\_point()**.

### template\<typename \_CharT\> virtual char\_type std::numpunct\< \_CharT \>::do\_decimal\_point () const \[inline\], \[protected\], \[virtual\], \[inherited\]

Return decimal point character. Returns a char\_type to use as a decimal point. This function is a hook for derived classes to change the value returned.

**Returns**

*char\_type* representing a decimal point.

Referenced by **decimal\_point()**.

### template\<typename \_CharT\> virtual string\_type std::numpunct\< \_CharT \>::do\_falsename () const \[inline\], \[protected\], \[virtual\], \[inherited\]

Return string representation of bool false. Returns a string\_type containing the text representation for false bool variables. This function is a hook for derived classes to change the value returned.

**Returns**

string\_type representing printed form of false.

Referenced by **falsename()**.

### template\<typename \_CharT\> virtual string std::numpunct\< \_CharT \>::do\_grouping () const \[inline\], \[protected\], \[virtual\], \[inherited\]

Return grouping specification. Returns a string representing groupings for the integer part of a number. This function is a hook for derived classes to change the value returned.

**See also**

grouping() for details.

**Returns**

String representing grouping specification.

Referenced by **grouping()**.

### template\<typename \_CharT\> virtual char\_type std::numpunct\< \_CharT \>::do\_thousands\_sep () const \[inline\], \[protected\], \[virtual\], \[inherited\]

Return thousands separator character. Returns a char\_type to use as a thousands separator. This function is a hook for derived classes to change the value returned.

**Returns**

*char\_type* representing a thousands separator.

Referenced by **thousands\_sep()**.

### template\<typename \_CharT\> virtual string\_type std::numpunct\< \_CharT \>::do\_truename () const \[inline\], \[protected\], \[virtual\], \[inherited\]

Return string representation of bool true. Returns a string\_type containing the text representation for true bool variables. This function is a hook for derived classes to change the value returned.

**Returns**

string\_type representing printed form of true.

Referenced by **truename()**.

### template\<typename \_CharT\> string\_type std::numpunct\< \_CharT \>::falsename () const \[inline\], \[inherited\]

Return string representation of bool false. This function returns a string\_type containing the text representation for false bool variables. It does so by calling numpunct\<char\_type\>::do\_falsename().

**Returns**

string\_type representing printed form of false.

References **do\_falsename()**.

### template\<typename \_CharT\> string std::numpunct\< \_CharT \>::grouping () const \[inline\], \[inherited\]

Return grouping specification. This function returns a string representing groupings for the integer part of a number. Groupings indicate where thousands separators should be inserted in the integer part of a number.

Each char in the return string is interpret as an integer rather than a character. These numbers represent the number of digits in a group. The first char in the string represents the number of digits in the least significant group. If a char is negative, it indicates an unlimited number of digits for the group. If more chars from the string are required to group a number, the last char is used repeatedly.

For example, if the grouping() returns "\\003\\002" and is applied to the number 123456789, this corresponds to 12,34,56,789. Note that if the string was "32", this would put more than 50 digits into the least significant group if the character set is ASCII.

The string is returned by calling numpunct\<char\_type\>::do\_grouping().

**Returns**

string representing grouping specification.

References **do\_grouping()**.

### template\<typename \_CharT\> char\_type std::numpunct\< \_CharT \>::thousands\_sep () const \[inline\], \[inherited\]

Return thousands separator character. This function returns a char\_type to use as a thousands separator. It does so by returning returning numpunct\<char\_type\>::do\_thousands\_sep().

**Returns**

char\_type representing a thousands separator.

References **do\_thousands\_sep()**.

### template\<typename \_CharT\> string\_type std::numpunct\< \_CharT \>::truename () const \[inline\], \[inherited\]

Return string representation of bool true. This function returns a string\_type containing the text representation for true bool variables. It does so by calling numpunct\<char\_type\>::do\_truename().

**Returns**

string\_type representing printed form of true.

References **do\_truename()**.

## Member Data Documentation

### template\<typename \_CharT\> locale::id std::numpunct\< \_CharT \>::id \[static\], \[inherited\]

Numpunct facet id.

## Author

Generated automatically by Doxygen for libstdc++ from the source code.
