More manipulator examples
#include <iostream>
#include <iomanip>
using namespace std;
int main() {
/* 5600 */ cout << setw( 14 ) << 56e2 << '\n';
/* 5600.00 */ cout << setw( 14 ) << showpoint << 56e+2 << '\n';
/*2.345678e+002 */ cout << setw( 14 ) << scientific << 234.5678 << '\n';
/* 255 */ cout << setw( 14 ) << 255 << '\n';
/* ff */ cout << setw( 14 ) << hex << 255 << '\n';
/* 377 */ cout << setw( 14 ) << oct << 255 << '\n';
/* 1 */ cout << setw( 14 ) << true << '\n';
/* true */ cout << setw( 14 ) << boolalpha << true << '\n';
/* 1234.567890 */ cout << setw( 14 ) << fixed << 1234.56789 << '\n';
/* 1234.568 */ cout << setw( 14 ) << fixed << setprecision(3) << 1234.56789 << '\n';
return 0;
}
/*
Output:
5600
5600.00
2.345678e+002
255
ff
377
1
true
1234.567890
1234.568
*/