I try this code for converting string to number and vic versa. this code must print the same outputs. but its output is not correct. can any one help me?
let formatter: NumberFormatter = NumberFormatter()
formatter.locale = Locale(identifier: "en_US")
if let r1 = formatter.number(from: "10123456789012349") , let r2 = formatter.string(from:r1){
print(r1) // output = 10123456789012349
print(r2) // output = 10123456789012348
}
also this code has same problem
print(formatter.string(from:NSNumber(value: 10123456789012349)))
//output is 10123456789012348