From 8da596f7b5fdbcf11fbda4aa66efc87a219f58ae Mon Sep 17 00:00:00 2001 From: crupest Date: Sat, 26 Feb 2022 20:33:02 +0800 Subject: ... --- include/cru/common/Format.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'include/cru/common/Format.h') diff --git a/include/cru/common/Format.h b/include/cru/common/Format.h index 2b08f03b..d99098b4 100644 --- a/include/cru/common/Format.h +++ b/include/cru/common/Format.h @@ -1,5 +1,6 @@ #pragma once +#include #include "Exception.h" #include "String.h" @@ -28,11 +29,12 @@ std::enable_if_t, String> ToString(T value) { return String::FromBuffer(b, size, size); } -template -std::enable_if_t, String> ToString(T value) { - auto str = std::to_string(value); - return String(str.cbegin(), str.cend()); -} +extern double_conversion::DoubleToStringConverter kDefaultDoubleToStringConverter; + +String ToString(float value, StringView option); +String ToString(double value, StringView option); +inline String ToString(float value) { return ToString(value, u""); } +inline String ToString(double value) { return ToString(value, u""); } template String ToString(const T& value, StringView option) { -- cgit v1.2.3