From cppreference.com

<iomanip> Defined in header template < class MoneyT >

/*unspecified*/ get_money ( MoneyT & mon, bool intl = false ) ; (since C++11)

When used in an expression in >> get_money(mon, intl), parses the character input as a monetary value, as specified by the std::money_get facet of the locale currently imbued in in , and stores the value in mon .

The extraction operation in in >> get_money(mon, intl) behaves as a FormattedInputFunction.

edit] Parameters

mon - variable where monetary value will be written. Can be either long double or basic_string intl - expects to find required international currency strings if true , expects optional currency symbols otherwise

edit] Return value

Returns an object of unspecified type such that if in is the name of an input stream of type std::basic_istream<CharT, Traits>, then the expression in >> get_money(mon, intl) behaves as if the following code was executed:

typedef std::istreambuf_iterator<CharT, Traits> Iter;

typedef std::money_get<CharT, Iter> MoneyGet;

std::ios_base::iostate err = std::ios_base::goodbit;

const MoneyGet &mg = std::use_facet<MoneyGet>(in.getloc());

mg.get(Iter(in.rdbuf()), Iter(), intl, in, err, mon);

if (std::ios_base::goodbit != err)

out.setstate(err);

edit] Example

edit] See also