diff --git a/doc/syntax.rst b/doc/syntax.rst index f6a5ff3c..af65616a 100644 --- a/doc/syntax.rst +++ b/doc/syntax.rst @@ -399,13 +399,15 @@ Using type-specific formatting:: fmt::print("{:%Y-%m-%d %H:%M:%S}", t); // Prints: 2010-08-04 12:15:58 +Using the comma as a thousands separator:: + + #include + + auto s = fmt::format(std::locale("en_US.UTF-8"), "{:n}", 1234567890); + // s == "1,234,567,890" + .. ifconfig:: False - Using the comma as a thousands separator:: - - format("{:,}", 1234567890); - '1,234,567,890' - Nesting arguments and more complex examples:: >>> for align, text in zip('<^>', ['left', 'center', 'right']):