tmp/tmpfrmeidz4/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
##### General <a id="locale.numpunct.general">[[locale.numpunct.general]]</a>
|
| 2 |
+
|
| 3 |
+
``` cpp
|
| 4 |
+
namespace std {
|
| 5 |
+
template<class charT>
|
| 6 |
+
class numpunct : public locale::facet {
|
| 7 |
+
public:
|
| 8 |
+
using char_type = charT;
|
| 9 |
+
using string_type = basic_string<charT>;
|
| 10 |
+
|
| 11 |
+
explicit numpunct(size_t refs = 0);
|
| 12 |
+
|
| 13 |
+
char_type decimal_point() const;
|
| 14 |
+
char_type thousands_sep() const;
|
| 15 |
+
string grouping() const;
|
| 16 |
+
string_type truename() const;
|
| 17 |
+
string_type falsename() const;
|
| 18 |
+
|
| 19 |
+
static locale::id id;
|
| 20 |
+
|
| 21 |
+
protected:
|
| 22 |
+
~numpunct(); // virtual
|
| 23 |
+
virtual char_type do_decimal_point() const;
|
| 24 |
+
virtual char_type do_thousands_sep() const;
|
| 25 |
+
virtual string do_grouping() const;
|
| 26 |
+
virtual string_type do_truename() const; // for bool
|
| 27 |
+
virtual string_type do_falsename() const; // for bool
|
| 28 |
+
};
|
| 29 |
+
}
|
| 30 |
+
```
|
| 31 |
+
|
| 32 |
+
`numpunct<>` specifies numeric punctuation. The specializations required
|
| 33 |
+
in [[locale.category.facets]] [[locale.category]], namely
|
| 34 |
+
`numpunct<{}wchar_t>` and `numpunct<char>`, provide classic `"C"`
|
| 35 |
+
numeric formats, i.e., they contain information equivalent to that
|
| 36 |
+
contained in the `"C"` locale or their wide character counterparts as if
|
| 37 |
+
obtained by a call to `widen`.
|
| 38 |
+
|
| 39 |
+
The syntax for number formats is as follows, where represents the radix
|
| 40 |
+
set specified by the `fmtflags` argument value, and and are the results
|
| 41 |
+
of corresponding `numpunct<charT>` members. Integer values have the
|
| 42 |
+
format:
|
| 43 |
+
|
| 44 |
+
``` bnf
|
| 45 |
+
intval:
|
| 46 |
+
signₒₚₜ units
|
| 47 |
+
```
|
| 48 |
+
|
| 49 |
+
``` bnf
|
| 50 |
+
sign:
|
| 51 |
+
'+'
|
| 52 |
+
'-'
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+
``` bnf
|
| 56 |
+
units:
|
| 57 |
+
digits
|
| 58 |
+
digits thousands-sep units
|
| 59 |
+
```
|
| 60 |
+
|
| 61 |
+
``` bnf
|
| 62 |
+
digits:
|
| 63 |
+
digit digitsₒₚₜ
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
+
and floating-point values have:
|
| 67 |
+
|
| 68 |
+
``` bnf
|
| 69 |
+
floatval:
|
| 70 |
+
signₒₚₜ units fractionalₒₚₜ exponentₒₚₜ
|
| 71 |
+
signₒₚₜ decimal-point digits exponentₒₚₜ
|
| 72 |
+
```
|
| 73 |
+
|
| 74 |
+
``` bnf
|
| 75 |
+
fractional:
|
| 76 |
+
decimal-point digitsₒₚₜ
|
| 77 |
+
```
|
| 78 |
+
|
| 79 |
+
``` bnf
|
| 80 |
+
exponent:
|
| 81 |
+
e signₒₚₜ digits
|
| 82 |
+
```
|
| 83 |
+
|
| 84 |
+
``` bnf
|
| 85 |
+
e:
|
| 86 |
+
'e'
|
| 87 |
+
'E'
|
| 88 |
+
```
|
| 89 |
+
|
| 90 |
+
where the number of digits between is as specified by `do_grouping()`.
|
| 91 |
+
For parsing, if the portion contains no thousands-separators, no
|
| 92 |
+
grouping constraint is applied.
|
| 93 |
+
|