Skip to content

Formatting negative numbers with compact: 'short' uses wrong units #805

@shivijais

Description

@shivijais

Using version - '1.4.0-alpha.0'

let formatter = Globalize.numberFormatter({
    compact: short,
    maximumSignificantDigits: 3,
    minimumSignificantDigits: 1
});
formatter(-230); //-0.23K . Expected => -230
formatter(-230000); //-0.23M . Expected => -230K
formatter(-230130000); //-0.23B . Expected => -230M
formatter(-230000000000); //-0.23T . Expected => -230B

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions