Format of a monetary number

Hello, I created a currency converter. How to make the result have numbers in thousand? Thank you

    import UIKit

class ChangeViewController: UIViewController {

@IBOutlet weak var usdamount: UITextField!

@IBOutlet weak var label: UILabel!



var noImput = "Merci de saisir une valeur"

var currencynum = Int()


override func viewDidLoad() {
    super.viewDidLoad()
    
    label.text = ""

    // Do any additional setup after loading the view.
    

    
}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}
// rejet du clavier
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?){
    view.endEditing(true)
    super.touchesBegan(touches, with: event)
}

@IBAction func currency(_ sender: UISegmentedControl) {
    
    
    switch sender.selectedSegmentIndex{
    case 0:
        currencynum = 0
        break
    case 1:
        currencynum = 1
        break
    default:
        break
    }
}

@IBAction func convert(_ sender: AnyObject) {
    
    if usdamount.text == "" {
        label.text = noImput
        
    } else {
        let num = Int(usdamount.text!)
    switch currencynum {
        
    case 0:
        let convertednum = Double(num!) * 14500
        label.text = "\(num!) Euro(s) = \(convertednum) Rupiah(s)"
        break
    case 1:
        let convertednum = Double(num!) * 0.000067
        label.text = "\(num!) Rupiah = \(convertednum) Euros"
        break
    default:
        break
    }
            }
}


}

Hi @fabrice,
have you looked at NumberFormatter you can pass it a numeric value and get a string value in the format of your choosing.

The other option is to use the String formatting by specifying the format yourself, like String(format:"%.2f", convertednum)

cheers,

Jayant