Skip to content

Commit

Permalink
Add format example for padded hex byte
Browse files Browse the repository at this point in the history
Fixes #2
  • Loading branch information
johnthagen authored and vitaut committed Mar 14, 2018
1 parent 7bab90e commit 9c5f54a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions doc/syntax.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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);
// 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

Using the comma as a thousands separator::
Expand Down

0 comments on commit 9c5f54a

Please sign in to comment.