Fix for issue 134
This fixed the issue filed in https://github.com/d3/d3-format/issues/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
👍
👍 thanks for this!
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.
@mbostock What is the process for getting this change approved+merged?
I’ll get to it eventually. I appreciate your patience.