I have an interesting problem with a specific conversion.
When I try to convert the string "0,3" or "0.3", according to the UICulture, to a Double value, the result is 0,29999999. I have not yet found a solution, in order to receive the result 0,3.
There is any way to have the same values after the conversion?
doublecannot represent every value. It guarantees to represent integers, but that is about it. If you need something more like “human” approximation of numbers, usedecimal:Note:
decimalalso doesn’t represent every value – but the way it does the approximation tends to be more like how people expect numbers to work. In particular,doubleis virtually useless for things like currency.