mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-02 11:28:20 +00:00
parent
7bab90e52d
commit
9c5f54a723
@ -365,6 +365,11 @@ Replacing ``%x`` and ``%o`` and converting the value to different bases::
|
|||||||
format("int: {0:d}; hex: {0:#x}; oct: {0:#o}; bin: {0:#b}", 42);
|
format("int: {0:d}; hex: {0:#x}; oct: {0:#o}; bin: {0:#b}", 42);
|
||||||
// Result: "int: 42; hex: 0x2a; oct: 052; bin: 0b101010"
|
// Result: "int: 42; hex: 0x2a; oct: 052; bin: 0b101010"
|
||||||
|
|
||||||
|
Padded hex byte with prefix and always prints both hex characters::
|
||||||
|
|
||||||
|
format("{:#04x}", 0);
|
||||||
|
// Result: "0x00"
|
||||||
|
|
||||||
.. ifconfig:: False
|
.. ifconfig:: False
|
||||||
|
|
||||||
Using the comma as a thousands separator::
|
Using the comma as a thousands separator::
|
||||||
|
Loading…
Reference in New Issue
Block a user