std::put_money

Header: <iomanip>

When used in an expression out « put_money(mon, intl), converts the monetary value mon to its character representation as specified by the std::money_put facet of the locale currently imbued in out.

# Declarations

template< class MoneyT >
/*unspecified*/ put_money( const MoneyT& mon, bool intl = false );

(since C++11)

# Parameters

# Return value

An object of unspecified type such that

# Example

#include <iomanip>
#include <iostream>
 
int main()
{
    long double mon = 123.45; // or std::string mon = "123.45";
 
    std::cout.imbue(std::locale("en_US.UTF-8"));
    std::cout << std::showbase
              << "en_US: " << std::put_money(mon)
              << " or " << std::put_money(mon, true) << '\n';
 
    std::cout.imbue(std::locale("ru_RU.UTF-8"));
    std::cout << "ru_RU: " << std::put_money(mon)
              << " or " << std::put_money(mon, true) << '\n';
 
    std::cout.imbue(std::locale("ja_JP.UTF-8"));
    std::cout << "ja_JP: " << std::put_money(mon)
              << " or " << std::put_money(mon, true) << '\n';
}

# See also