Add format example for padded hex byte

Fixes #2
This commit is contained in:
johnthagen 2018-03-13 18:10:56 -04:00 committed by GitHub
parent c37c4c437e
commit 8ece076d15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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::