docs: Some docs updated to reflect the latest formatting changes

This commit is contained in:
Mateusz Pusz
2024-04-18 22:37:24 +01:00
parent fa04e93687
commit c5afd722e7
3 changed files with 4 additions and 4 deletions

View File

@ -242,9 +242,9 @@ quantity q = (90. * km / h).in(mph);
std::cout << "Number: " << q.numerical_value_in(mph) << "\n";
std::cout << "Unit: " << q.unit << "\n";
std::cout << "Dimension: " << q.dimension << "\n";
std::println("{:{%N:.2f}%?%U}", q);
std::println("{::N[.2f]}", q);
std::println("{:.4f} in {} of {}", q.numerical_value_in(mph), q.unit, q.dimension);
std::println("{:{%N:.4f} in %U of %D}", q);
std::println("{:%N in %U of %D:N[.4f]}", q);
```
```text

View File

@ -491,7 +491,7 @@ room_temp room_ref{};
room_temp room_low = room_ref - number_of_steps * step_delta;
room_temp room_high = room_ref + number_of_steps * step_delta;
std::println("Room reference temperature: {} ({}, {:{%N:.2f}%?%U})\n",
std::println("Room reference temperature: {} ({}, {::N[.2f]})\n",
room_ref.quantity_from_zero(),
room_ref.in(usc::degree_Fahrenheit).quantity_from_zero(),
room_ref.in(si::kelvin).quantity_from_zero());

View File

@ -1006,7 +1006,7 @@ TEST_CASE("localization with the 'L' specifier", "[text][fmt][localization]")
std::locale grp2{std::locale::classic(), new group2};
std::locale grp3{std::locale::classic(), new group3};
SECTION("full format {:{%N:L}%?%U} on a quantity")
SECTION("full format on a quantity")
{
SECTION("default spec")
{