]> git.stg.codes - stg.git/blobdiff - stglibs/common.lib/common.cpp
Fixed x2str for doubles.
[stg.git] / stglibs / common.lib / common.cpp
index 787b813d3728bf975571f4401756ad3863526a8a..db2ff6b3e555e768127eb7943594b378cf4b4525 100644 (file)
@@ -790,6 +790,14 @@ const std::string & x2str(uint64_t x, std::string & s)
 return unsigned2str(x, s);
 }
 //---------------------------------------------------------------------------
 return unsigned2str(x, s);
 }
 //---------------------------------------------------------------------------
+const std::string & x2str(double x, std::string & s)
+{
+char buf[256];
+snprintf(buf, sizeof(buf), "%f", x);
+s = buf;
+return s;
+}
+//---------------------------------------------------------------------------
 std::string & TrimL(std::string & val)
 {
 size_t pos = val.find_first_not_of(" \t");
 std::string & TrimL(std::string & val)
 {
 size_t pos = val.find_first_not_of(" \t");