Skip to content

Conversation

@GlenKelley
Copy link
Contributor

@GlenKelley GlenKelley commented Jan 20, 2023

Fixes #134

This changes the behaviour from:

>formatPrefix("(~s", 1e3)(-1e3)`
(1)k

To be:

>formatPrefix("(~s", 1e3)(-1e3)`
(1k) 

A side effect of this change is we now include the unit to be included in the padding length, e.g:

>formatPrefix("(~s", 1e3)(-1e3)`
      −$42.0M

Becomes:

>formatPrefix("(~s", 1e3)(-1e3)`
     −$42.0M

@treloar
Copy link

treloar commented Jan 20, 2023

👍

@declanjscott
Copy link

declanjscott commented Jan 20, 2023

👍 thanks for this!

@GlenKelley
Copy link
Contributor Author

GlenKelley commented Jan 20, 2023

Note it would be cleaner if this was supported by the formatSpecifier, but that would require extending the format regex to support fixed suffix strings.

@GlenKelley
Copy link
Contributor Author

@mbostock What is the process for getting this change approved+merged?

@mbostock
Copy link
Member

mbostock commented Feb 1, 2023

I’ll get to it eventually. I appreciate your patience.

@mbostock mbostock merged commit 17585db into d3:main Jan 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Unit is generated outside parenthesis for negative numbers

4 participants