Support for NSFormatter

Saw this about 3 months ago in one of the pull requests by @bhirt-bpl , there were merge conflicts that might be too late now to deal with, so I moved them to the latest commit. hopefully this makes it in