put_money in C++
The put_money function is the counterpart of get_money function is used to format and output a monetary value to the given output stream.
Syntax of put_money
put_money(const moneyT& mon, bool intl = false);
Here,
- mon: represents the object where the monetary value will be stored
- intl: Boolean value which is true of international representation and false otherwise.
Example of put_money
C++
#include <iostream> #include<ios> #include<iomanip> using namespace std; int main() { cout<< "The amount is : " <<put_money(100.51L)<<endl; return 0; } |
The amount is : 101
< iomanip > Header in C++
In C++, the <iomanip> header file defines the manipulator functions that are used to manipulate the format of the input and output of our program. It is a part of the input/output library in C++. In this article, we will discuss the functions and facilities provided in the <iomanip> header file in C++ with examples.