swift - NSNumberFormatter inside a computed Property -


i trying format string number nsnumberformatter. code looks this:

var displayvalue: double? {     {         let = "4.2"         return nsnumberformatter().numberfromstring(i)?.doublevalue     } } 

the property nil, missing?

martin r! right locale issue "4,2" works fine, thanks!


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -