mirror of
https://github.com/fmtlib/fmt.git
synced 2025-11-28 05:09:44 +01:00
Use grouping() from locale for specifier 'n'
This commit is contained in:
@@ -205,6 +205,9 @@ template <typename Locale> Locale locale_ref::get() const {
|
||||
return locale_ ? *static_cast<const std::locale*>(locale_) : std::locale();
|
||||
}
|
||||
|
||||
template <typename Char> FMT_FUNC std::string grouping_impl(locale_ref loc) {
|
||||
return std::use_facet<std::numpunct<Char>>(loc.get<std::locale>()).grouping();
|
||||
}
|
||||
template <typename Char> FMT_FUNC Char thousands_sep_impl(locale_ref loc) {
|
||||
return std::use_facet<std::numpunct<Char>>(loc.get<std::locale>())
|
||||
.thousands_sep();
|
||||
@@ -216,6 +219,10 @@ template <typename Char> FMT_FUNC Char decimal_point_impl(locale_ref loc) {
|
||||
} // namespace internal
|
||||
#else
|
||||
template <typename Char>
|
||||
FMT_FUNC std::string internal::grouping_impl(locale_ref) {
|
||||
return "\03";
|
||||
}
|
||||
template <typename Char>
|
||||
FMT_FUNC Char internal::thousands_sep_impl(locale_ref) {
|
||||
return FMT_STATIC_THOUSANDS_SEPARATOR;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user