mirror of
https://github.com/fmtlib/fmt.git
synced 2025-01-12 06:37:28 +00:00
Add locale example
This commit is contained in:
parent
fd1cabe464
commit
0b2eb6501c
@ -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::
|
Using the comma as a thousands separator::
|
||||||
|
|
||||||
format("{:,}", 1234567890);
|
#include <fmt/locale.h>
|
||||||
'1,234,567,890'
|
|
||||||
|
auto s = fmt::format(std::locale("en_US.UTF-8"), "{:n}", 1234567890);
|
||||||
|
// s == "1,234,567,890"
|
||||||
|
|
||||||
|
.. ifconfig:: False
|
||||||
|
|
||||||
Nesting arguments and more complex examples::
|
Nesting arguments and more complex examples::
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user