import RxSwift
import PlaygroundSupport
import Foundation
PlaygroundPage.current.needsIndefiniteExecution = true

let disposeBag = DisposeBag()

// Map Example – Number Formatter

let formatter = NumberFormatter()
formatter.numberStyle = .spellOut

Observable<NSNumber>.of(123, 4, 25)
    .map {
        formatter.string(from: $0) ?? ""
    }
    .subscribe(onNext: {
        print($0)
    })
    .addDisposableTo(disposeBag)
