config: try to fix float locale issues

This commit is contained in:
Megamouse 2023-02-24 15:26:00 +01:00
parent afad96a52a
commit e46dba43ad
4 changed files with 39 additions and 4 deletions

View file

@ -384,12 +384,24 @@ namespace cfg
std::string to_string() const override
{
return std::to_string(m_value);
std::string result;
if (try_to_string(&result, m_value))
{
return result;
}
return "0.0";
}
std::string def_to_string() const override
{
return std::to_string(def);
std::string result;
if (try_to_string(&result, def))
{
return result;
}
return "0.0";
}
bool from_string(std::string_view value, bool /*dynamic*/ = false) override