I have an english string that may or may not have numbers. But i want those numbers to be printed on screen as Persian numbers.
For example if NSString *foo =
NSString *foo =
In swift 3:
func convertEngNumToPersianNum(num: String)->String{ let number = NSNumber(value: Int(num)!) let format = NumberFormatter() format.locale = Locale(identifier: "fa_IR") let faNumber = format.string(from: number) return faNumber! }
Check before force unwrap to prevent crash.