Latest 1.1.0
License MIT
Platforms ios 8.0, osx 10.8, tvos 9.0, watchos 2.0, requires ARC

Version Status Platform Carthage compatible MIT License

A collection of useful NSFormatter subclasses. The purpose of these formatters is to provide either missing functionality or to make the existing NSFormatters reliable for use in a high-concurrency multi-threaded environments such as that of a web-server.

I’ve used these formatters when making the website in order to format the number of requests served and the time the app has been running.

Here’s what’s in the package:

  • CSLargeNumberFormatter – formats large numbers to a more human-readable number format. Instead of 1450000 it will output 1.4 M and so on.
  • CSTimeIntervalFormatter – makes it a bit easier and more reliable to format time intervals.

Getting Started

Installation through CocoaPods

Install using CocoaPods by adding this line to your Podfile:


target 'MyApp' do
  pod 'CSOddFormatters', '~> 1.0’

In your Project

import CSOddFormatters



The preffered way of using it is through the class methods stringFromNumber: and numberFromString:, but it can also be used as any regular NSNumberFormatter.

import CSOddFormatters

print(CSLargeNumberFormatter.numberFromString("123.5 M"))

Check out the complete reference at


The preffered way of using it is through the class methods stringFromTimeInterval:, stringFromDate:toDate: and stringFromDateComponents:, but it can also be used as any regular NSDateComponentsFormatter.


print(NSTimeIntervalFormatter.stringFromDate(NSDate.distantPast(), toDate:NSDate.distantFuture))

Check out the complete reference at

What’s Next

Check out the complete documentation on CocoaDocs.

Latest podspec

    "name": "CSOddFormatters",
    "version": "1.1.0",
    "license": "MIT",
    "summary": "A collection of useful NSFormatter subclasses.",
    "homepage": "",
    "authors": {
        "Cu0103tu0103lin Stan": "[email protected]"
    "social_media_url": "",
    "source": {
        "git": "",
        "tag": "1.1.0"
    "module_name": "CSOddFormatters",
    "source_files": "CSOddFormatters/*.{h,m}",
    "public_header_files": [
    "platforms": {
        "ios": "8.0",
        "osx": "10.8",
        "tvos": "9.0",
        "watchos": "2.0"
    "ios": {
        "frameworks": "Foundation"
    "osx": {
        "frameworks": "Foundation"
    "tvos": {
        "frameworks": "Foundation"
    "watchos": {
        "frameworks": "Foundation"
    "requires_arc": true

Pin It on Pinterest

Share This