Improve handling of format specs

This commit is contained in:
Victor Zverovich
2024-01-15 05:56:15 -08:00
parent c98a5a599f
commit f9294f0e60
7 changed files with 129 additions and 133 deletions

View File

@@ -584,7 +584,7 @@ template <class charT> struct formatter<std::complex<double>, charT> {
specs.precision, specs.precision_ref, ctx);
auto fspecs = std::string();
if (specs.precision > 0) fspecs = fmt::format(".{}", specs.precision);
if (specs.type == presentation_type::fixed_lower) fspecs += 'f';
if (specs.type == presentation_type::fixed) fspecs += 'f';
auto real = fmt::format(ctx.locale().template get<std::locale>(),
fmt::runtime("{:" + fspecs + "}"), c.real());
auto imag = fmt::format(ctx.locale().template get<std::locale>(),