added stringutil::to_string
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <vector>
|
||||
#include <locale>
|
||||
#include <iomanip>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <algorithm>
|
||||
@@ -162,3 +163,9 @@ void util::trim(std::string &s) {
|
||||
rtrim(s);
|
||||
ltrim(s);
|
||||
}
|
||||
|
||||
std::wstring util::to_wstring(double x, int precision) {
|
||||
std::wstringstream ss;
|
||||
ss << std::fixed << std::setprecision(precision) << x;
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user