From 6986d6c7e8511bf402394959a525449f792d9713 Mon Sep 17 00:00:00 2001 From: Triang3l Date: Sat, 28 Aug 2021 23:06:28 +0300 Subject: [PATCH] [Config] Use locale-neutral fmt instead of to_string --- src/xenia/base/cvar.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/xenia/base/cvar.h b/src/xenia/base/cvar.h index 6047b1bd8..1f92d0766 100644 --- a/src/xenia/base/cvar.h +++ b/src/xenia/base/cvar.h @@ -15,8 +15,9 @@ #include #include -#include "cpptoml/include/cpptoml.h" -#include "cxxopts/include/cxxopts.hpp" +#include "third_party/cpptoml/include/cpptoml.h" +#include "third_party/cxxopts/include/cxxopts.hpp" +#include "third_party/fmt/include/fmt/format.h" #include "xenia/base/assert.h" #include "xenia/base/filesystem.h" #include "xenia/base/string_util.h" @@ -216,7 +217,10 @@ inline std::string CommandVar::ToString( template std::string CommandVar::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