+
Skip to content

Unit is generated outside parenthesis for negative numbers #134

@GlenKelley

Description

@GlenKelley

When using the Accounting number format which uses parentheses for negative numbers, and also using units, the units will be placed outside the parenthesis which is atypical and is not consistent with the behaviour between format and formatPrefix.

For example, this appears broken:

formatPrefix("(~s", 1e3)(-1e3) will produce (1)k, instead of (1k).

But this works as intended:

format("(~s")(-1e3) will produce (1k)

The above example is the simplest reproduction of the error, but there are cases where formatPrefix is required. For example:

formatPrefix("($,.6~f", 1e6)(-1e3) will produce ($0.1)M instead of ($0.1M)

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

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载