Share via


moneypunct::do_neg_format

A protected virtual member function that is called to return a locale-specific rule for formatting outputs with negative amounts.

virtual pattern do_neg_format( ) const;

Return Value

The protected virtual member function returns a locale-specific rule for determining how to generate a monetary output field for a negative amount. Each of the four elements of pattern::field can have the values:

  • none to match zero or more spaces or generate nothing.

  • sign to match or generate a positive or negative sign.

  • space to match zero or more spaces or generate a space.

  • symbol to match or generate a currency symbol.

  • value to match or generate a monetary value.

Components of a monetary output field are generated and components of a monetary input field are matched in the order in which these elements appear in pattern::field. Each of the values sign, symbol, value, and either none or space must appear exactly once. The value none must not appear first. The value space must not appear first or last. If Intl is true, the order is symbol, sign, none, then value.

The template version of moneypunct<CharType, Intl> returns {money_base::symbol, money_base::sign, money_base::value, money_base::none}.

Example

See the example for neg_format, where the virtual member function is called by neg_format.

Requirements

Header: <locale>

Namespace: std

See Also

Reference

moneypunct Class

Other Resources

moneypunct Members