You can do it with NSNumberFormatter
Swift 4
let largeNumber = 31908551587
let numberFormatter = NumberFormatter()
numberFormatter.numberStyle = .decimal
let formattedNumber = numberFormatter.string(from: NSNumber(value:largeNumber))
Swift 3
let largeNumber = 31908551587
let numberFormatter = NumberFormatter()
numberFormatter.numberStyle = NumberFormatter.Style.decimal
let formattedNumber = numberFormatter.string(from: NSNumber(value:largeNumber))
Swift 2
let largeNumber = 31908551587
let numberFormatter = NSNumberFormatter()
numberFormatter.numberStyle = NSNumberFormatterStyle.DecimalStyle
let formattedNumber = numberFormatter.stringFromNumber(largeNumber)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…