feat: do not print space between a number and percent or per_mille

This commit is contained in:
Mateusz Pusz
2024-01-19 21:20:33 +01:00
parent e51a5f6e8e
commit 1df2cc7b58
2 changed files with 7 additions and 2 deletions

View File

@@ -233,11 +233,11 @@ TEST_CASE("operator<< on a quantity", "[text][ostream][fmt]")
const auto q = value_cast<percent>(15. * isq::length[m] / (100. * isq::length[m]));
os << q;
SECTION("iostream") { CHECK(os.str() == "15 %"); }
SECTION("iostream") { CHECK(os.str() == "15%"); }
SECTION("fmt with default format {} on a quantity") { CHECK(MP_UNITS_STD_FMT::format("{}", q) == os.str()); }
SECTION("fmt with format {:%Q %q} on a quantity") { CHECK(MP_UNITS_STD_FMT::format("{:%Q %q}", q) == os.str()); }
SECTION("fmt with format {:%Q %q} on a quantity") { CHECK(MP_UNITS_STD_FMT::format("{:%Q %q}", q) == "15 %"); }
}
SECTION("radians")