From Jason Turner

[locale.money.get.virtuals]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpacj9ybh6/{from.md → to.md} +22 -15
tmp/tmpacj9ybh6/{from.md → to.md} RENAMED
@@ -19,13 +19,17 @@ does not change `err`; otherwise, sets `err` to `(err|str.failbit)`, or
19
  does not change `units` or `digits`. Uses the pattern returned by
20
  `mp.neg_format()` to parse all values. The result is returned as an
21
  integral value stored in `units` or as a sequence of digits possibly
22
  preceded by a minus sign (as produced by `ct.widen(c)` where `c` is
23
  `’-’` or in the range from `’0’` through `’9’`, inclusive) stored in
24
- `digits`. The sequence `$1,056.23` in a common United States locale
25
- would yield, for `units`, `105623`, or, for `digits`, `"105623"`. If
26
- `mp.grouping()` indicates that no thousands separators are permitted,
 
 
 
 
27
  any such characters are not read, and parsing is terminated at the point
28
  where they first appear. Otherwise, thousands separators are optional;
29
  if present, they are checked for correct placement only after all format
30
  components have been read.
31
 
@@ -41,27 +45,30 @@ format; otherwise, the currency symbol is required.
41
 
42
  If the first character (if any) in the string `pos` returned by
43
  `mp.positive_sign()` or the string `neg` returned by
44
  `mp.negative_sign()` is recognized in the position indicated by `sign`
45
  in the format pattern, it is consumed and any remaining characters in
46
- the string are required after all the other format components. If
47
- `showbase` is off, then for a `neg` value of `"()"` and a currency
48
- symbol of `"L"`, in `"(100 L)"` the `"L"` is consumed; but if `neg` is
49
- `"-"`, the `"L"` in `"-100 L"` is not consumed. If `pos` or `neg` is
50
- empty, the sign component is optional, and if no sign is detected, the
51
- result is given the sign that corresponds to the source of the empty
52
- string. Otherwise, the character in the indicated position must match
53
- the first character of `pos` or `neg`, and the result is given the
54
- corresponding sign. If the first character of `pos` is equal to the
55
- first character of `neg`, or if both strings are empty, the result is
56
- given a positive sign.
 
 
 
57
 
58
  Digits in the numeric monetary component are extracted and placed in
59
  `digits`, or into a character buffer `buf1` for conversion to produce a
60
  value for `units`, in the order in which they appear, preceded by a
61
  minus sign if and only if the result is negative. The value `units` is
62
- produced as if by[^19]
63
 
64
  ``` cpp
65
  for (int i = 0; i < n; ++i)
66
  buf2[i] = src[find(atoms, atoms+sizeof(src), buf1[i]) - atoms];
67
  buf2[n] = 0;
 
19
  does not change `units` or `digits`. Uses the pattern returned by
20
  `mp.neg_format()` to parse all values. The result is returned as an
21
  integral value stored in `units` or as a sequence of digits possibly
22
  preceded by a minus sign (as produced by `ct.widen(c)` where `c` is
23
  `’-’` or in the range from `’0’` through `’9’`, inclusive) stored in
24
+ `digits`.
25
+
26
+ [*Example 1*: The sequence `$1,056.23` in a common United States locale
27
+ would yield, for `units`, `105623`, or, for `digits`,
28
+ `"105623"`. — *end example*]
29
+
30
+ If `mp.grouping()` indicates that no thousands separators are permitted,
31
  any such characters are not read, and parsing is terminated at the point
32
  where they first appear. Otherwise, thousands separators are optional;
33
  if present, they are checked for correct placement only after all format
34
  components have been read.
35
 
 
45
 
46
  If the first character (if any) in the string `pos` returned by
47
  `mp.positive_sign()` or the string `neg` returned by
48
  `mp.negative_sign()` is recognized in the position indicated by `sign`
49
  in the format pattern, it is consumed and any remaining characters in
50
+ the string are required after all the other format components.
51
+
52
+ [*Example 2*: If `showbase` is off, then for a `neg` value of `"()"`
53
+ and a currency symbol of `"L"`, in `"(100 L)"` the `"L"` is consumed;
54
+ but if `neg` is `"-"`, the `"L"` in `"-100 L"` is not
55
+ consumed. *end example*]
56
+
57
+ If `pos` or `neg` is empty, the sign component is optional, and if no
58
+ sign is detected, the result is given the sign that corresponds to the
59
+ source of the empty string. Otherwise, the character in the indicated
60
+ position must match the first character of `pos` or `neg`, and the
61
+ result is given the corresponding sign. If the first character of `pos`
62
+ is equal to the first character of `neg`, or if both strings are empty,
63
+ the result is given a positive sign.
64
 
65
  Digits in the numeric monetary component are extracted and placed in
66
  `digits`, or into a character buffer `buf1` for conversion to produce a
67
  value for `units`, in the order in which they appear, preceded by a
68
  minus sign if and only if the result is negative. The value `units` is
69
+ produced as if by[^20]
70
 
71
  ``` cpp
72
  for (int i = 0; i < n; ++i)
73
  buf2[i] = src[find(atoms, atoms+sizeof(src), buf1[i]) - atoms];
74
  buf2[n] = 0;