d3.scale.linear()
.domain([-0.505, 1])
.nice()
.domain();
returns this
[-0.6000000000000001, 1]
But what I would really like is this
[-0.6, 1]
Edit:
As mentioned in comments, the cause of this explained in Is floating point math broken?.
This question is about the best way to get the desired result in the context of d3. Maybe the best approach is simply string formatting. But, I'd like to see if anyone has a novel solution to this particular case.