-2

This question has been answered in objective-c here. How can I do it in Swift?

Anthon
  • 69,918
  • 32
  • 186
  • 246
Dmomo
  • 83
  • 1
  • 1
  • 12

1 Answers1

2
import UIKit

let nf = NumberFormatter()
nf.currencySymbol = ""
nf.numberStyle = .currency
let stringForNumber = nf.string(for: 100)  // "100.00"
Leo Dabus
  • 229,809
  • 59
  • 489
  • 571