File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed
Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -513,13 +513,9 @@ impl FormatSpec {
513513 Some ( _) | None => Err ( "%c arg not in range(0x110000)" ) ,
514514 } ,
515515 } ,
516- Some ( FormatType :: GeneralFormatUpper ) => {
517- Err ( "Unknown format code 'G' for object of type 'int'" )
518- }
519- Some ( FormatType :: GeneralFormatLower ) => {
520- Err ( "Unknown format code 'g' for object of type 'int'" )
521- }
522- Some ( FormatType :: FixedPointUpper )
516+ Some ( FormatType :: GeneralFormatUpper )
517+ | Some ( FormatType :: GeneralFormatLower )
518+ | Some ( FormatType :: FixedPointUpper )
523519 | Some ( FormatType :: FixedPointLower )
524520 | Some ( FormatType :: ExponentUpper )
525521 | Some ( FormatType :: ExponentLower )
Original file line number Diff line number Diff line change @@ -64,3 +64,5 @@ def test_zero_padding():
6464assert f"{ 123.456 :010,} " == "00,123.456"
6565assert f"{ 123.456 :011,} " == "000,123.456"
6666assert f"{ 123.456 :+011,} " == "+00,123.456"
67+ assert f"{ 1234 :.3g} " == "1.23e+03"
68+ assert f"{ 1234567 :.6G} " == "1.23457E+06"
You can’t perform that action at this time.
0 commit comments