19#include <fmt/format.h>
27 return fmt::format(
"{}", l);
29 static const std::string numbers[] = {
"k",
"M",
"B",
"T",
"Qa",
"Qn",
"Sx",
"Sp",
"O",
30 "N",
"De",
"Ud",
"Dd",
"Td",
"Qd",
"Qi",
"Sd"};
31 int exponent =
static_cast<int>(log10(abs(l)) / 3);
34 double d =
static_cast<double>(l) / pow(10, exponent * 3);
37 const int precision = 100;
38 d = round(d * precision) / precision;
40 return fmt::format(
"{} {}", d, numbers[exponent - 1]);
std::string LongToHumanString(int64_t l)
Definition: utilnumberdisplay.h:25