mirror of
https://github.com/shadps4-emu/ext-fmt.git
synced 2025-03-03 07:38:44 +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,
|
FMT_FUNC auto write_loc(appender out, loc_value value,
|
||||||
const format_specs& specs, locale_ref loc) -> bool {
|
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>();
|
auto locale = loc.get<std::locale>();
|
||||||
// We cannot use the num_put<char> facet because it may produce output in
|
// We cannot use the num_put<char> facet because it may produce output in
|
||||||
// a wrong encoding.
|
// 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 std::use_facet<facet>(locale).put(out, value, specs);
|
||||||
return facet(locale).put(out, value, specs);
|
return facet(locale).put(out, value, specs);
|
||||||
#endif
|
#endif
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user