settings test
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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_
|
||||
|
||||
Reference in New Issue
Block a user