From 08def386b559c18d624273d11254594ffb934333 Mon Sep 17 00:00:00 2001 From: bolero-MURAKAMI Date: Mon, 16 Apr 2012 20:19:47 +0900 Subject: [PATCH] fix float to_string --- sprout/string/float_to_string.hpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sprout/string/float_to_string.hpp b/sprout/string/float_to_string.hpp index 07158ab3..545694ef 100644 --- a/sprout/string/float_to_string.hpp +++ b/sprout/string/float_to_string.hpp @@ -14,7 +14,10 @@ #include namespace sprout { - SPROUT_STATIC_CONSTEXPR std::size_t decimal_places_length = 6; + namespace detail { + SPROUT_STATIC_CONSTEXPR std::size_t decimal_places_length = 6; + } // namespace detail + // // printed_float_digits // @@ -22,8 +25,8 @@ namespace sprout { struct printed_float_digits : public std::integral_constant< std::size_t, - /*std::numeric_limits::max_exponent10 + decimal_places_length + 3*/ - sprout::integer_digits::value + decimal_places_length + 3 + /*std::numeric_limits::max_exponent10 + sprout::detail::decimal_places_length + 3*/ + sprout::integer_digits::value + sprout::detail::decimal_places_length + 3 > {}; @@ -121,13 +124,13 @@ namespace sprout { -val, true, sprout::detail::float_extract_rounded(-val), - decimal_places_length + sprout::detail::decimal_places_length ) : sprout::detail::float_to_string_impl( val, false, sprout::detail::float_extract_rounded(val), - decimal_places_length + sprout::detail::decimal_places_length ) ; }