I'm using iOS charts to chart some data in my Swift iOS app including some times. The times are stored in Int variables as seconds but obviously people don't want to see 1 hour and 45 minutes on the Y axis as 6300 so I need to format it.
iOS charts lets you set use an NSNumberFormatter to do this like so
var formatter: NSNumberFormatter = NSNumberFormatter()
formatter.numberStyle = NSNumberFormatterStyle.SpellOutStyle
chartHolder.leftAxis.valueFormatter = formatter
This won't work with an NSNumberFormatterStyle - its options are too limited for you. What you should do, is subclass
NSNumberFormatter, and override the
stringFromNumber: function. There you can do all the string manipulation you want.