diff --git a/src/ObjWriting/InfoString/InfoStringFromStructConverterBase.cpp b/src/ObjWriting/InfoString/InfoStringFromStructConverterBase.cpp index 4c394f17..c06adaf9 100644 --- a/src/ObjWriting/InfoString/InfoStringFromStructConverterBase.cpp +++ b/src/ObjWriting/InfoString/InfoStringFromStructConverterBase.cpp @@ -2,6 +2,7 @@ #include #include +#include InfoStringFromStructConverterBase::InfoStringFromStructConverterBase(const void* structure) : m_structure(structure), @@ -78,13 +79,23 @@ void InfoStringFromStructConverterBase::FillFromQBoolean(const std::string& key, void InfoStringFromStructConverterBase::FillFromFloat(const std::string& key, const size_t offset) { const auto* num = reinterpret_cast(reinterpret_cast(m_structure) + offset); - m_info_string.SetValueForKey(key, std::to_string(*num)); + + std::ostringstream ss; + ss << *num; + + m_info_string.SetValueForKey(key, ss.str()); } void InfoStringFromStructConverterBase::FillFromMilliseconds(const std::string& key, const size_t offset) { const auto* millis = reinterpret_cast(reinterpret_cast(m_structure) + offset); - m_info_string.SetValueForKey(key, std::to_string(static_cast(*millis) / 1000.0f)); + + const auto value = static_cast(*millis) / 1000.0f; + + std::ostringstream ss; + ss << value; + + m_info_string.SetValueForKey(key, ss.str()); } void InfoStringFromStructConverterBase::FillFromScriptString(const std::string& key, const size_t offset)