When using 'formatPrefix' (which is preferred because it treats the precision as the number of digits past the decimal) it places the si prefix outside of the parentheses.
'format' handles this correctly, although it requires us to calculate the number of significant digits to the left of the decimal to arrive at similar functionality.
see:
const val = -694712
d3.formatPrefix("($.0~", val)(val)
// ($695)k
d3.format("($.3s")(val)
// ($695k)