I would like to format numbers on y-axes of the graph.
Instad of a 1.000.000.000 €, I would like to format it like this : 1 B€
I can achieve to display 1.000,00 € by applying the formatter to y-axes, like this :
let numberFormatter = NumberFormatter() numberFormatter.positiveFormat = "#,###.00 €" self.yAxis?.labelFormatter?.formatter = numberFormatter
There is no good way of dividing the number in format to display B€, so I create my own class NumberFormatterWithMask that override method string(from: number), that handle this.
If I use this new Formatter any where else, it is working perfect, but if I do this for y-axis it doesn’t
let numberFormatter = NumberFormatterWithMask() numberFormatter.positiveFormat = "#,###.00 B€" self.yAxis?.labelFormatter?.formatter = numberFormatter
Which method of the formatter is used for displaying the numbers?