emu/rendlay.cpp: Fixed locale-sensitive number handling (fixes MT08521).

This commit is contained in:
Vas Crabb 2022-11-29 02:39:24 +11:00
parent 7e0266be64
commit b36c7a90bf

View File

@ -224,12 +224,18 @@ private:
{ {
if (m_float_valid) if (m_float_valid)
{ {
m_text = std::to_string(m_float); std::ostringstream stream;
stream.imbue(std::locale::classic());
stream << m_float;
m_text = std::move(stream).str();
m_text_valid = true; m_text_valid = true;
} }
else if (m_int_valid) else if (m_int_valid)
{ {
m_text = std::to_string(m_int); std::ostringstream stream;
stream.imbue(std::locale::classic());
stream << m_int;
m_text = std::move(stream).str();
m_text_valid = true; m_text_valid = true;
} }
} }