Answers for "how to format big numbers with commas in c++"

C++
0

how to format big numbers with commas in c++

#include <iomanip>
#include <locale>

template<class T>
std::string FormatWithCommas(T value)
{
    std::stringstream ss;
    ss.imbue(std::locale(""));
    ss << std::fixed << value;
    return ss.str();
}
Posted by: Guest on September-08-2021

Code answers related to "how to format big numbers with commas in c++"

Browse Popular Code Answers by Language