您需要先将阿拉伯数字字符串转换为英语,然后执行计算部分.
let numberStr: String = "????????" let formatter: NumberFormatter = NumberFormatter() formatter.locale = NSLocale(localeIdentifier: "EN") as Locale! let final = formatter.number(from: numberStr) let doubleNumber = Double(final!) print("\(doubleNumber)")