From 6a137350006bcf4e247798fde858af5e10552002 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Tue, 8 Oct 2024 11:02:24 +0200 Subject: [PATCH] Use stringstream for double formatting --- libmei/addons/att.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libmei/addons/att.cpp b/libmei/addons/att.cpp index 8ef1428ce5c..74cb90d94dc 100644 --- a/libmei/addons/att.cpp +++ b/libmei/addons/att.cpp @@ -32,7 +32,9 @@ std::string Att::StrToStr(std::string str) const std::string Att::DblToStr(double data) const { - return StringFormat("%.10g", round(data * 10000.0) / 10000.0); + std::stringstream sstream; + sstream << round(data * 10000.0) / 10000.0; + return sstream.str(); } std::string Att::IntToStr(int data) const @@ -365,7 +367,9 @@ data_KEYSIGNATURE Att::StrToKeysignature(const std::string &value, bool logWarni std::string Att::MeasurebeatToStr(data_MEASUREBEAT data) const { - return StringFormat("%dm+%.10g", data.first, round(data.second * 10000.0) / 10000.0); + std::stringstream sstream; + sstream << data.first << "m+" << round(data.second * 10000.0) / 10000.0; + return sstream.str(); } data_MEASUREBEAT Att::StrToMeasurebeat(std::string value, bool) const