Commit 0b2eb650 authored by Victor Zverovich's avatar Victor Zverovich

Add locale example

parent fd1cabe4
...@@ -399,12 +399,14 @@ Using type-specific formatting:: ...@@ -399,12 +399,14 @@ Using type-specific formatting::
fmt::print("{:%Y-%m-%d %H:%M:%S}", t); fmt::print("{:%Y-%m-%d %H:%M:%S}", t);
// Prints: 2010-08-04 12:15:58 // Prints: 2010-08-04 12:15:58
.. ifconfig:: False Using the comma as a thousands separator::
#include <fmt/locale.h>
Using the comma as a thousands separator:: auto s = fmt::format(std::locale("en_US.UTF-8"), "{:n}", 1234567890);
// s == "1,234,567,890"
format("{:,}", 1234567890); .. ifconfig:: False
'1,234,567,890'
Nesting arguments and more complex examples:: Nesting arguments and more complex examples::
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment