diff --git a/util/format.h b/util/format.h index e0e9bbf..de5ae5a 100644 --- a/util/format.h +++ b/util/format.h @@ -1,5 +1,6 @@ #pragma once #include +#include #include #include @@ -25,4 +26,11 @@ inline std::string format(const char* fmt, ...) return std::string(buf.data(), needed); } + +inline std::string to_string_trimmed(double value) +{ + std::ostringstream oss; + oss << std::defaultfloat << value; + return oss.str(); +} } // namespace trnr \ No newline at end of file