I have got a SQL table with a property 'Stock' and datatype float. According to several posts the equivalent type in C# is double.
So I have got a input which is a string and I convert it to a double value like this:
var number = Convert.ToDouble(numberAsString, CultureInfo.CurrentCulture.NumberFormat);
I have the follwing code to add the number on top of the stock:
result.Bestand += number;
Somehow (this is really strange to me) if I add "0,1" exactly three times, the value changes to 15,299999999999999
. I don't know why though.
Remember: I am using commas instead of decimal points.