The
moneypunct<>
facet defines monetary formatting parameters used by
money_get<>
and
money_put<>. A monetary format is a sequence of four components,
specified by a
pattern
value
p,
such that the
part
value
static_cast<part>(p.field[i])
determines the
ith
component of the format
In the
field
member of a
pattern
object, each value
symbol,
sign,
value,
and either
space
or
none
appears exactly once
. The value
none,
if present, is not first;
the value
space,
if present, is neither first nor last
.Where
none
or
space
appears, white space is permitted in the format,
except where
none
appears at the end, in which case no white space is permitted
. The value
space
indicates that at least one space is required at that position
. Where
symbol
appears, the sequence of characters returned by
curr_symbol()
is permitted, and can be required
. Where
sign
appears, the first (if any) of the sequence of characters returned by
positive_sign()
or
negative_sign()
(respectively as the monetary value is non-negative or negative) is required
. Any remaining characters of the sign sequence are required after all
other format components
. Where
value
appears, the absolute numeric monetary value is required
.The format of the numeric monetary value is a decimal number:
value ::= units [ decimal-point [ digits ]] |
decimal-point digits
if
frac_digits()
returns a positive value, or
value ::= units
The symbol
decimal-point
indicates the character returned by
decimal_point(). The other symbols are defined as follows:
units ::= digits [ thousands-sep units ]
digits ::= adigit [ digits ]
In the syntax specification, the symbol
adigit
is any of the values
ct.widen(c)
for
c
in the range
'0'
through
'9',
inclusive, and
ct
is a reference of type
const ctype<charT>&
obtained as described in the definitions of
money_get<>
and
money_put<>. The symbol
thousands-sep
is the character returned by
thousands_sep(). The space character used is the value
ct.widen(' '). White space characters are those characters
c
for which
ci.is(space, c)
returns
true. The number of digits required after the decimal point (if any)
is exactly the value returned by
frac_digits().