Skip to content

Incorrect abbreviations for values rounded up #187

Closed
@gscottolson

Description

@gscottolson

There is a specific case in Numeral where values with abbreviation formats are not rounded up properly to the next abbreviation. There are two test cases I added (locally) that fail to format properly:

...
[999950,'0.0a','1m'],
[999999999,'0.0a','1b'],
...

The above cases will output incorrect abbreviation values:

999950 ⟶ 1000.0k
999999999 ⟶ 1000.0m

The logic around abbreviation bracketing is causing this issue. I tried creating a patch for this, but I couldn’t find a quick solution that didn’t introduce additional test failures.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions