We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ac0d4d0 commit 46b5c90Copy full SHA for 46b5c90
orm_lib/src/SqlBinder.cc
@@ -18,6 +18,9 @@
18
#include <drogon/utils/Utilities.h>
19
#include <future>
20
#include <regex>
21
+#if defined(__cpp_lib_format)
22
+#include <format>
23
+#endif
24
#if USE_MYSQL
25
#include <mysql.h>
26
#endif
@@ -259,7 +262,14 @@ SqlBinder &SqlBinder::operator<<(double f)
259
262
parameters_.push_back((char *)(obj.get()));
260
263
return *this;
261
264
}
- return operator<<(std::to_string(f));
265
+
266
267
+ return operator<<(std::format("{:.17g}", f));
268
+#else
269
+ std::stringstream ss;
270
+ ss << std::setprecision(17) << f;
271
+ return operator<<(ss.str());
272
273
274
275
SqlBinder &SqlBinder::operator<<(std::nullptr_t)
0 commit comments