From 4850c6f50a729e03587c5821e79909e17504cb00 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Sat, 22 Feb 2020 16:45:19 -0500 Subject: [PATCH] Use correct format specifier --- include/boost/static_string/static_string.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/static_string/static_string.hpp b/include/boost/static_string/static_string.hpp index 68a556a..94ac21c 100644 --- a/include/boost/static_string/static_string.hpp +++ b/include/boost/static_string/static_string.hpp @@ -510,7 +510,7 @@ to_static_string_float_impl(long double value) noexcept std::char_traits::find(buffer, N, '.'); // we want at least 2 decimal places if (!period || std::size_t(period - buffer) > N - 3) - std::snprintf(buffer, N + 1, "%.*e", int(N > 7 ? N - 7 : 0), value); + std::snprintf(buffer, N + 1, "%.*Le", int(N > 7 ? N - 7 : 0), value); } // this will not throw return static_string(buffer); @@ -552,7 +552,7 @@ to_static_wstring_float_impl(long double value) noexcept std::char_traits::find(buffer, N, '.'); // we want at least 2 decimal places if (!period || std::size_t(period - buffer) > N - 3) - std::swprintf(buffer, N + 1, L"%.*e", int(N > 7 ? N - 7 : 0), value); + std::swprintf(buffer, N + 1, L"%.*Le", int(N > 7 ? N - 7 : 0), value); } // this will not throw return static_wstring(buffer);