i am trying to format a string to a number with NSNumberFormatter. My code looks like this:
var displayValue: Double? {
get {
let i = "4.2"
return NSNumberFormatter().numberFromString(i)?.doubleValue
}
}
The property is always nil, what am i missing?
Martin R! is right it was a locale issue "4,2" works fine, thanks!