[Config] Use locale-neutral fmt instead of to_string

This commit is contained in:
Triang3l 2021-08-28 23:06:28 +03:00 committed by Rick Gibbed
parent 64366979c7
commit 6986d6c7e8
1 changed files with 7 additions and 3 deletions

View File

@ -15,8 +15,9 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "cpptoml/include/cpptoml.h" #include "third_party/cpptoml/include/cpptoml.h"
#include "cxxopts/include/cxxopts.hpp" #include "third_party/cxxopts/include/cxxopts.hpp"
#include "third_party/fmt/include/fmt/format.h"
#include "xenia/base/assert.h" #include "xenia/base/assert.h"
#include "xenia/base/filesystem.h" #include "xenia/base/filesystem.h"
#include "xenia/base/string_util.h" #include "xenia/base/string_util.h"
@ -216,7 +217,10 @@ inline std::string CommandVar<std::filesystem::path>::ToString(
template <class T> template <class T>
std::string CommandVar<T>::ToString(T val) { std::string CommandVar<T>::ToString(T val) {
return std::to_string(val); // Use fmt::format instead of std::to_string for locale-neutral formatting of
// floats, always with a period rather than a comma, which is treated as an
// unidentified trailing character by cpptoml.
return fmt::format("{}", val);
} }
template <class T> template <class T>