clean up main

This commit is contained in:
Drath
2025-09-11 18:29:09 +02:00
parent 2783e41f2a
commit b3e339027f
5 changed files with 50 additions and 54 deletions

View File

@@ -11,6 +11,13 @@ std::string pNum(float num, uint8_t decs) {
return pNum((double)num, decs);
}
// pads given string to length
std::string pad(std::string s, uint8_t len, bool ljust) {
if (len > s.size())
s.insert(ljust ? s.end() : s.begin(), len - s.size(), FILL_CHAR);
return s;
}
// converts large number in (k)bytes to human readable numer with suffix and sane decimal
std::string pBytes(double bytes, bool isKbytes) {