settings test

This commit is contained in:
MihailRis
2024-03-29 13:58:19 +03:00
parent a4960097f0
commit 32120d8af4
10 changed files with 125 additions and 27 deletions
+6
View File
@@ -164,6 +164,12 @@ void util::trim(std::string &s) {
ltrim(s);
}
std::string util::to_string(double x) {
std::stringstream ss;
ss << x;
return ss.str();
}
std::wstring util::to_wstring(double x, int precision) {
std::wstringstream ss;
ss << std::fixed << std::setprecision(precision) << x;
+2 -1
View File
@@ -21,6 +21,7 @@ namespace util {
extern void rtrim(std::string &s);
extern void trim(std::string &s);
extern std::string to_string(double x);
extern std::wstring to_wstring(double x, int precision);
extern std::string base64_encode(const ubyte* data, size_t size);
@@ -49,4 +50,4 @@ namespace util {
extern std::vector<std::wstring> split(const std::wstring& str, char delimiter);
}
#endif // UTIL_STRINGUTIL_H_
#endif // UTIL_STRINGUTIL_H_