2
var primBreed = Double(Int(eggMulYearTextField.text!)!)
    primBreed = dblAnnProd / primBreed
    primBreedLabel.text = String(format:"%.2f", primBreed) 
  // Result:282258.26 Desired result: 282,258.26

Trying a different question about the use of NSNumber formatter.. I made progress and was able to partially format my result obtaining decimal, I am looking for the correct way to use NSNumber formatter to add comma separators. Thanks in advance!

rmaddy
  • 314,917
  • 42
  • 532
  • 579
kawwy
  • 43
  • 3
  • http://stackoverflow.com/questions/29999024/adding-thousand-separator-to-int-in-swift, http://stackoverflow.com/questions/28936474/swift-how-to-format-a-large-number-with-thousands-seperators – nicael Dec 18 '15 at 19:09

0 Answers0