X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/2a1f23881feba670f3bb614e19409b5f4e90b211..624f31fdf2c7726745dbfc53b7a16be6ff715023:/stglibs/common.lib/common.cpp diff --git a/stglibs/common.lib/common.cpp b/stglibs/common.lib/common.cpp index b871b36b..7ba78e1d 100644 --- a/stglibs/common.lib/common.cpp +++ b/stglibs/common.lib/common.cpp @@ -804,6 +804,13 @@ const std::string & x2str(uint64_t x, std::string & s) return unsigned2str(x, s); } //--------------------------------------------------------------------------- +const std::string & x2str(double x, std::string & s) +{ +char buf[256]; +s = snprintf(buf, sizeof(buf), "%f", x); +return s; +} +//--------------------------------------------------------------------------- std::string & TrimL(std::string & val) { size_t pos = val.find_first_not_of(" \t"); @@ -833,6 +840,12 @@ std::string & Trim(std::string & val) return TrimR(TrimL(val)); } //--------------------------------------------------------------------------- +std::string Trim(const std::string & val) +{ +std::string res(val); +return TrimR(TrimL(res)); +} +//--------------------------------------------------------------------------- std::string ToLower(const std::string & value) { std::string res;