]> git.stg.codes - stg.git/blobdiff - stglibs/common.lib/common.cpp
Added x2str for double type.
[stg.git] / stglibs / common.lib / common.cpp
index 787b813d3728bf975571f4401756ad3863526a8a..dab99605a71fe6a16d6c83db60a88f86825f4101 100644 (file)
@@ -790,6 +790,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");