These are chat archives for dev-pt/javascript

10th
May 2016
João Horta
@jpamarohorta
May 10 2016 13:57
hey, has anyone ever used d3.format (https://github.com/mbostock/d3/wiki/Formatting#d3_format) ?
I'm trying to have a mix between SI-prefix ("s") and fixed ("f")
Ricardo Otero
@rikas
May 10 2016 13:58
me
João Horta
@jpamarohorta
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
@nogdacosta
May 10 2016 14:04
never used d3.format, but would d3.formatPrefix help?
João Horta
@jpamarohorta
May 10 2016 14:10
hmm not sure
that will only return the prefix and the value
João Horta
@jpamarohorta
May 10 2016 14:55
I solved it by using different formats for very small numbers vs all the other numbers :\