diff --git a/README.md b/README.md index f5b93998..aabb9b4d 100644 --- a/README.md +++ b/README.md @@ -120,11 +120,11 @@ int main() std::cout << v1 << '\n'; // 110 km/h std::cout << std::setw(10) << std::setfill('*') << v2 << '\n'; // ***70 mi/h std::cout << std::format("{:*^10}\n", v3); // *110 km/h* - std::println("{:%N in %U}", v4); // 70 in mi/h + std::println("{:%N in %U of %D}", v4); // 70 in mi/h of LT⁻¹ std::println("{:{%N:.2f}%?%U}", v5); // 30.56 m/s - std::println("{:{%N:.2f}%?{%U:n}}", v6); // 31.29 m s⁻¹ + std::println("{:{%N:.2f}%?{%U:dn}}", v6); // 31.29 m⋅s⁻¹ std::println("{:%N}", v7); // 31 } ``` -_Try it on the [Compiler Explorer](https://godbolt.org/z/hWzxf1j1M)._ +_Try it on the [Compiler Explorer](https://godbolt.org/z/n8GEdfeed)._ diff --git a/docs/getting_started/look_and_feel.md b/docs/getting_started/look_and_feel.md index b67906a7..545bb368 100644 --- a/docs/getting_started/look_and_feel.md +++ b/docs/getting_started/look_and_feel.md @@ -99,9 +99,9 @@ performed without sacrificing accuracy. Please see the below example for a quick std::cout << v1 << '\n'; // 110 km/h std::cout << std::setw(10) << std::setfill('*') << v2 << '\n'; // ***70 mi/h std::cout << std::format("{:*^10}\n", v3); // *110 km/h* - std::println("{:%N in %U}", v4); // 70 in mi/h + std::println("{:%N in %U of %D}", v4); // 70 in mi/h of LT⁻¹ std::println("{:{%N:.2f}%?%U}", v5); // 30.56 m/s - std::println("{:{%N:.2f}%?{%U:n}}", v6); // 31.29 m s⁻¹ + std::println("{:{%N:.2f}%?{%U:dn}}", v6); // 31.29 m⋅s⁻¹ std::println("{:%N}", v7); // 31 } ``` @@ -143,14 +143,14 @@ performed without sacrificing accuracy. Please see the below example for a quick std::cout << v1 << '\n'; // 110 km/h std::cout << std::setw(10) << std::setfill('*') << v2 << '\n'; // ***70 mi/h std::cout << std::format("{:*^10}\n", v3); // *110 km/h* - std::println("{:%N in %U}", v4); // 70 in mi/h + std::println("{:%N in %U of %D}", v4); // 70 in mi/h of LT⁻¹ std::println("{:{%N:.2f}%?%U}", v5); // 30.56 m/s - std::println("{:{%N:.2f}%?{%U:n}}", v6); // 31.29 m s⁻¹ + std::println("{:{%N:.2f}%?{%U:dn}}", v6); // 31.29 m⋅s⁻¹ std::println("{:%N}", v7); // 31 } ``` -!!! example "[Try it on Compiler Explorer](https://godbolt.org/z/hWzxf1j1M)" +!!! example "[Try it on Compiler Explorer](https://godbolt.org/z/n8GEdfeed)" !!! note diff --git a/example/hello_units.cpp b/example/hello_units.cpp index c54b9b04..93523e36 100644 --- a/example/hello_units.cpp +++ b/example/hello_units.cpp @@ -58,11 +58,11 @@ int main() constexpr quantity v6 = value_cast(v4); constexpr quantity v7 = value_cast(v6); - std::cout << v1 << '\n'; // 110 km/h - std::cout << std::setw(10) << std::setfill('*') << v2 << '\n'; // ***70 mi/h - std::cout << MP_UNITS_STD_FMT::format("{:*^10}\n", v3); // *110 km/h* - std::cout << MP_UNITS_STD_FMT::format("{:%N in %U}\n", v4); // 70 in mi/h - std::cout << MP_UNITS_STD_FMT::format("{:{%N:.2f}%?%U}\n", v5); // 30.56 in m/s - std::cout << MP_UNITS_STD_FMT::format("{:{%N:.2f}%?{%U:n}}\n", v6); // 31.29 in m s⁻¹ - std::cout << MP_UNITS_STD_FMT::format("{:%N}\n", v7); // 31 + std::cout << v1 << '\n'; // 110 km/h + std::cout << std::setw(10) << std::setfill('*') << v2 << '\n'; // ***70 mi/h + std::cout << MP_UNITS_STD_FMT::format("{:*^10}\n", v3); // *110 km/h* + std::cout << MP_UNITS_STD_FMT::format("{:%N in %U of %D}\n", v4); // 70 in mi/h of LT⁻¹ + std::cout << MP_UNITS_STD_FMT::format("{:{%N:.2f}%?%U}\n", v5); // 30.56 in m/s + std::cout << MP_UNITS_STD_FMT::format("{:{%N:.2f}%?{%U:dn}}\n", v6); // 31.29 in m⋅s⁻¹ + std::cout << MP_UNITS_STD_FMT::format("{:%N}\n", v7); // 31 }