diff --git a/src/include/units/physical/si/prefixes.h b/src/include/units/physical/si/prefixes.h index 4a0dcf99..449b5754 100644 --- a/src/include/units/physical/si/prefixes.h +++ b/src/include/units/physical/si/prefixes.h @@ -29,26 +29,26 @@ namespace units::si { struct prefix : prefix_family {}; // clang-format off -struct yocto : units::prefix> {}; -struct zepto : units::prefix> {}; -struct atto : units::prefix> {}; -struct femto : units::prefix> {}; -struct pico : units::prefix> {}; -struct nano : units::prefix> {}; -struct micro : units::prefix> {}; -struct milli : units::prefix> {}; -struct centi : units::prefix> {}; -struct deci : units::prefix> {}; -struct deca : units::prefix> {}; -struct hecto : units::prefix> {}; -struct kilo : units::prefix> {}; -struct mega : units::prefix> {}; -struct giga : units::prefix> {}; -struct tera : units::prefix> {}; -struct peta : units::prefix> {}; -struct exa : units::prefix> {}; -struct zetta : units::prefix> {}; -struct yotta : units::prefix> {}; +struct yocto : units::prefix> {}; +struct zepto : units::prefix> {}; +struct atto : units::prefix> {}; +struct femto : units::prefix> {}; +struct pico : units::prefix> {}; +struct nano : units::prefix> {}; +struct micro : units::prefix> {}; +struct milli : units::prefix> {}; +struct centi : units::prefix> {}; +struct deci : units::prefix> {}; +struct deca : units::prefix> {}; +struct hecto : units::prefix> {}; +struct kilo : units::prefix> {}; +struct mega : units::prefix> {}; +struct giga : units::prefix> {}; +struct tera : units::prefix> {}; +struct peta : units::prefix> {}; +struct exa : units::prefix> {}; +struct zetta : units::prefix> {}; +struct yotta : units::prefix> {}; // clang-format on } // namespace units::si diff --git a/test/unit_test/runtime/fmt_test.cpp b/test/unit_test/runtime/fmt_test.cpp index 3bedfde9..3f7455ac 100644 --- a/test/unit_test/runtime/fmt_test.cpp +++ b/test/unit_test/runtime/fmt_test.cpp @@ -722,6 +722,16 @@ TEST_CASE("format string with %Aq for unit with no ASCII quantity unit symbol sh CHECK(fmt::format("{:%Aq}", 123q_km_per_h) == "km/h"); } +TEST_CASE("format string with only %q for unit with ASCII quantity unit prefix symbol should print Unicode quantity unit prefix symbol only", "[text][fmt]") +{ + CHECK(fmt::format("{:%Q%q}", 123q_uV) == "123\u00b5V"); +} + +TEST_CASE("format string with %Aq for unit with ASCII quantity unit prefix symbol should print ASCII quantity unit prefix symbol only", "[text][fmt]") +{ + CHECK(fmt::format("{:%Q%Aq}", 123q_uV) == "123uV"); +} + TEST_CASE("%q and %Q can be put anywhere in a format string", "[text][fmt]") { SECTION("no space")