mirror of
https://github.com/fmtlib/fmt.git
synced 2025-01-26 12:35:32 +00:00
Fix handling of static separator
This commit is contained in:
parent
ae181cc93d
commit
44c3fe1ebb
@ -110,7 +110,11 @@ template <typename Char> FMT_FUNC Char decimal_point_impl(locale_ref) {
|
||||
|
||||
FMT_FUNC auto write_loc(appender out, loc_value value,
|
||||
const format_specs& specs, locale_ref loc) -> bool {
|
||||
#ifndef FMT_STATIC_THOUSANDS_SEPARATOR
|
||||
#ifdef FMT_STATIC_THOUSANDS_SEPARATOR
|
||||
value.visit(loc_writer<>{
|
||||
out, specs, std::string(1, FMT_STATIC_THOUSANDS_SEPARATOR), "\3", "."});
|
||||
return true;
|
||||
#else
|
||||
auto locale = loc.get<std::locale>();
|
||||
// We cannot use the num_put<char> facet because it may produce output in
|
||||
// a wrong encoding.
|
||||
@ -119,7 +123,6 @@ FMT_FUNC auto write_loc(appender out, loc_value value,
|
||||
return std::use_facet<facet>(locale).put(out, value, specs);
|
||||
return facet(locale).put(out, value, specs);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
} // namespace detail
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user