let formatter = NumberFormatter()
let sample1 = formatter.number(from: "29.99") ---> 29.99
let sample2 = formatter.number(from: "79.99") ---> 79.98999999999999
But I expect to get 79.99 as the result of sample2
Tried using different rounding modes with no help
This happens because a
Floating Point Number. You can see what is FPN in hereIf you need 2 decimal value with round , you can use this extension link