mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-02 19:39:49 +09:00
Merge pull request #4403 from yt2b/fix_exponential_format
Fix exponential format
This commit is contained in:
@@ -513,13 +513,9 @@ impl FormatSpec {
|
||||
Some(_) | None => Err("%c arg not in range(0x110000)"),
|
||||
},
|
||||
},
|
||||
Some(FormatType::GeneralFormatUpper) => {
|
||||
Err("Unknown format code 'G' for object of type 'int'")
|
||||
}
|
||||
Some(FormatType::GeneralFormatLower) => {
|
||||
Err("Unknown format code 'g' for object of type 'int'")
|
||||
}
|
||||
Some(FormatType::FixedPointUpper)
|
||||
Some(FormatType::GeneralFormatUpper)
|
||||
| Some(FormatType::GeneralFormatLower)
|
||||
| Some(FormatType::FixedPointUpper)
|
||||
| Some(FormatType::FixedPointLower)
|
||||
| Some(FormatType::ExponentUpper)
|
||||
| Some(FormatType::ExponentLower)
|
||||
|
||||
@@ -64,3 +64,5 @@ assert f"{123.456:09,}" == "0,123.456"
|
||||
assert f"{123.456:010,}" == "00,123.456"
|
||||
assert f"{123.456:011,}" == "000,123.456"
|
||||
assert f"{123.456:+011,}" == "+00,123.456"
|
||||
assert f"{1234:.3g}" == "1.23e+03"
|
||||
assert f"{1234567:.6G}" == "1.23457E+06"
|
||||
|
||||
Reference in New Issue
Block a user