You can use a third argument on axis.tickFormat to customise the formatting of the last tick.
There’s another example which uses parentNode.nextSibling
. Unfortunately, this wasn’t working correctly for me across transitions in a React environment.