You should be able to use d3.format
instead of writing your own format function for this.
d3.svg.axis()
.tickFormat(d3.format("d"));
You can also use tickFormat
on your scale which the axis will automatically use by default.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…