MCPcopy Create free account
hub / github.com/HO-COOH/FastCopy / ToString

Method ToString

FastCopy/ReadableUnitConverter.h:34–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32 public:
33 template<typename Char>
34 static auto ToString(size_t bytes)
35 {
36 if (bytes <= ToKB)
37 return std::format(FormatString<Char>::B, bytes);
38 else if (bytes <= ToMB)
39 return std::format(FormatString<Char>::KB, static_cast<double>(bytes) / ToKB);
40 else if (bytes <= ToGB)
41 return std::format(FormatString<Char>::MB, static_cast<double>(bytes) / ToMB);
42 else return std::format(FormatString<Char>::GB, static_cast<double>(bytes) / ToGB);
43 }
44
45 };
46

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected