Skip to content

Allow currency groupings in inconsistent_digit_grouping #6059

@ghost

Description

I'm writing a program which stores some amount of cents as an unsigned integer. It's basically a fixed-point decimal. So, it makes sense to place an underscore before the last two digits, but clippy flips out over this. For example, the following does not pass the lint:

fn one_million_dollars() -> u64 {
    1_000_000_00
}

I propose that the behavior should be changed so that literals with no fractional part can have a final grouping of two digits. If everyone agrees, I'd be willing to implement the change myself.

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