Several of the format specifiers have uppercase versions that cause the conversion to use uppercase where appropriate.
The following table describes the effect.
| Specifier | Effect |
|---|---|
| %A | Causes the hexadecimal digits a through f to be displayed in uppercase as A through F. Also, the prefix 0x is displayed as 0X, and the p will be displayed as P. |
| %B | Uppercase the values true and false. |
| %E | Causes the e symbol that indicates the exponent to be displayed in uppercase. |
| %G | Causes the e symbol that indicates the exponent to be displayed in uppercase. |
| %H | Causes the hexadecimal digits a through f to be displayed in uppercase as A through F. |
| %S | Uppercase the corresponding string. |
| %T | Causes all alphabetical output to be displayed in uppercase. |
| %X | Causes the hexadecimal digits a through f to be displayed in uppercase as A through F. Also, the optional prefix 0x is displayed as 0X, if present. |
For example, this call:
fmt.format("%X", 250);
creates this string:
FA
This call:
fmt.format("%E", 123.1234);
creates this string:
1.231234E+02