From 6b8144a5acde60d97920d99399ccd0fba2675c80 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Wed, 14 Sep 2022 06:38:29 -0700 Subject: [PATCH] Update locale docs --- doc/api.rst | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/doc/api.rst b/doc/api.rst index 711d3109..29988606 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -156,19 +156,6 @@ Compatibility .. doxygentypedef:: fmt::string_view -Locale ------- - -All formatting is locale-independent by default. Use the ``'L'`` format -specifier to insert the appropriate number separator characters from the -locale:: - - #include - #include - - std::locale::global(std::locale("en_US.UTF-8")); - auto s = fmt::format("{:L}", 1000000); // s == "1,000,000" - .. _format-api: Format API @@ -404,6 +391,23 @@ normally don't do any allocations for built-in and string types except for non-default floating-point formatting that occasionally falls back on ``sprintf``. +Locale +------ + +All formatting is locale-independent by default. Use the ``'L'`` format +specifier to insert the appropriate number separator characters from the +locale:: + + #include + #include + + std::locale::global(std::locale("en_US.UTF-8")); + auto s = fmt::format("{:L}", 1000000); // s == "1,000,000" + +.. doxygenfunction:: format(const Locale& loc, format_string fmt, T&&... args) -> std::string +.. doxygenfunction:: format_to(OutputIt out, const Locale& loc, format_string fmt, T&&... args) -> OutputIt +.. doxygenfunction:: formatted_size(const Locale& loc, format_string fmt, T&&... args) -> size_t + .. _ranges-api: Range and Tuple Formatting