I search how to replace a comma separator by a dot in numberPad in UITextField with Swift 5 please.
I tried this but it didn't work.
let commaValue = textField.text!
let decimalValue = Double(commaValue.replacingOccurrences(of: ",", with: "."))
I search how to replace a comma separator by a dot in numberPad in UITextField with Swift 5 please.
I tried this but it didn't work.
let commaValue = textField.text!
let decimalValue = Double(commaValue.replacingOccurrences(of: ",", with: "."))
You could use this:
let commaValue = "2,3"
let replaced = String(commaValue.map {
$0 == "," ? "." : $0 })