Merge pull request #4383 from yt2b/fix_hex_prefix

Fix hex prefix
This commit is contained in:
Jim Fasarakis-Hilliard
2022-12-30 16:52:27 +02:00
committed by GitHub
2 changed files with 2 additions and 1 deletions

View File

@@ -28,3 +28,4 @@ assert f'{1024:_}' == '1_024'
assert f'{65536:,}' == '65,536'
assert f'{4294967296:,}' == '4,294,967,296'
assert 'F' == "{0:{base}}".format(15, base="X")
assert f'{255:#X}' == "0XFF"

View File

@@ -456,7 +456,7 @@ impl FormatSpec {
Some(FormatType::Binary) => "0b",
Some(FormatType::Octal) => "0o",
Some(FormatType::HexLower) => "0x",
Some(FormatType::HexUpper) => "0x",
Some(FormatType::HexUpper) => "0X",
_ => "",
}
} else {