Add note in docs regarding uppercase 'X' specifier

I noticed that when using string format to print hexadecimal numbers like the following:

>>> '{:#X}'.format(1234)
'0X4D2'

I get an uppercase 'X', this is worth mentioning in the docs.
This commit is contained in:
gotlibsh 2020-04-03 17:22:17 +03:00 committed by GitHub
parent b74468e233
commit 12ec96eeb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -463,6 +463,8 @@ The available integer presentation types are:
+---------+----------------------------------------------------------+
| ``'X'`` | Hex format. Outputs the number in base 16, using |
| | upper-case letters for the digits above 9. |
| | Note: In case # is specified, the prefix '0x' will be |
| | uppercased as well. |
+---------+----------------------------------------------------------+
| ``'n'`` | Number. This is the same as ``'d'``, except that it uses |
| | the current locale setting to insert the appropriate |