Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit is generated outside parenthesis for negative numbers #134

Open
GlenKelley opened this issue Jan 19, 2023 · 0 comments
Open

Unit is generated outside parenthesis for negative numbers #134

GlenKelley opened this issue Jan 19, 2023 · 0 comments

Comments

@GlenKelley
Copy link

GlenKelley commented Jan 19, 2023

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant