oops this needs to be first

This commit is contained in:
Drath
2025-07-03 01:04:37 +02:00
parent add5e361c4
commit 3421b03973

View File

@@ -31,6 +31,14 @@ struct mem_usage_t {
bool daemon_mode = false;
/* DISPLAY FUNCS */
// converts number to string with given decimal places
std::string pNum(auto num, uint8_t decs = 0) {
std::stringstream ret;
ret << std::fixed << std::setprecision(decs) << num;
return ret.str();
}
// converts large number in (k)bytes to human readable numer with suffix and sane decimal
std::string pBytes(double bytes, bool isKbytes = false) {
std::array suffix_list = {'K', 'M', 'G', 'T', 'P', 'E', 'Z'};
@@ -47,13 +55,6 @@ std::string pBytes(double bytes, bool isKbytes = false) {
return "++++";
}
// converts number to string with given decimal places
std::string pNum(auto num, uint8_t decs = 0) {
std::stringstream ret;
ret << std::fixed << std::setprecision(decs) << num;
return ret.str();
}
// pads given string to length
std::string pad(std::string s, uint8_t len, bool ljust = false) {
if (len > s.size())