Skip to content

Panic occurs when formatting with separator and some format specifier #6212

@yt2b

Description

@yt2b
>>>>> f"{123456:,g}"

thread 'main' panicked at common/src/format.rs:429:18:
Separators only valid for numbers!
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
>>>>> f"{123456:,e}"

thread 'main' panicked at common/src/format.rs:429:18:
Separators only valid for numbers!
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

But in Python 3.13.5, output is below.

>>> f"{123456:,g}"
'123,456'
>>> f"{123456:,e}"
'1.234560e+05'

I'll fix this bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions