C++ Utilities
Loading...
Searching...
No Matches
thousands.h

Some utility functions that help you print large numbers in a readable format by forcing a stream or locale to insert appropriate commas. See the Pretty Printing page for all the details. More...

Go to the source code of this file.

Classes

struct  utilities::commas_facet
 A std::numpunct facet that puts the commas in the thousand spots so 10000.5 -> 10,000.5. More...

Namespaces

namespace  utilities
 The namespace for the utilities library.

Functions

void utilities::imbue_stream_with_commas (std::ios_base &strm=std::cout, bool on=true)
 Force a stream to insert commas into large numbers for readability so that 23456.7 is printed as 23,456.7.
void utilities::imbue_global_with_commas (bool on=true)
 Force the global locale to insert commas into large numbers so that 23456.7 is printed as 23,456.7.
void utilities::pretty_print_thousands (bool on=true)
 Force the global locale & the usual output streams to insert commas into large numbers.

Detailed Description

Some utility functions that help you print large numbers in a readable format by forcing a stream or locale to insert appropriate commas. See the Pretty Printing page for all the details.