How to create and class a 100% customized NSNumberFormatter in Swift. Useful when frameworks (*cough* 'ios-charts') require a NSNumberFormatter for value formatting.

When using an API/Framework you may need to provide a NSNumberFormatter.

iosChart.valueFormatter=MyCustomNSNumberFormatter

But what happens if one of the options NSNumberFormatter has doesn't have the options you want and you need something highly customized. And when I say custom, I don't mean deciding if you need a currency style.

NSNumberFormatter().numberStyle=NSNumberFormatterStyle.CurrencyStyle

I mean if you need something highly customized then you need to create a subclass and override the stringFromNumber method. Here is an example of how I needed to turn the number of seconds into the format mm:ss but using a custom NSNumberFormatter ('ios-charts' required this).