These are chat archives for dev-pt/javascript

May 2016
João Horta
May 10 2016 13:57
hey, has anyone ever used d3.format ( ?
I'm trying to have a mix between SI-prefix ("s") and fixed ("f")
Ricardo Otero
May 10 2016 13:58
João Horta
May 10 2016 13:59
I need to use the SI prefix when the numbers are big
with that the axis shows me for example: 0.0/10k/20k/30k
but if I try to use the same formatting when the numbers are really small (for example only 1 point with 1 of value) this is the generated axis: 0.0/00m/00m/1.0
any idea how can I have SI-prefix without the 0.0 and the 00m?
André Costa
May 10 2016 14:04
never used d3.format, but would d3.formatPrefix help?
João Horta
May 10 2016 14:10
hmm not sure
that will only return the prefix and the value
João Horta
May 10 2016 14:55
I solved it by using different formats for very small numbers vs all the other numbers :\