how to format big numbers with commas in c 2b 2b

Solutions on MaxInterview for how to format big numbers with commas in c 2b 2b by the best coders in the world

showing results for - "how to format big numbers with commas in c 2b 2b"
Isabelle
06 Jun 2016
1#include <iomanip>
2#include <locale>
3
4template<class T>
5std::string FormatWithCommas(T value)
6{
7    std::stringstream ss;
8    ss.imbue(std::locale(""));
9    ss << std::fixed << value;
10    return ss.str();
11}
12
similar questions