Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

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();
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #format #big #numbers #commas
ADD COMMENT
Topic
Name
3+3 =