how to format big numbers with commas in c++
#include <iostream>
#include <iomanip>
#include <locale>
int main() {
long long bigNumber = 1234567890123456LL;
// Create a locale with the classic numeric formatting
std::locale classicLocale("en_US.utf8");
// Set the locale to classic numeric formatting
std::cout.imbue(classicLocale);
// Output the big number with commas
std::cout << std::fixed << std::setprecision(0) << bigNumber << std::endl;
return 0;
}