I have a strange issue using double numbers in C# . NET here is my test:
double my_value = 0.49;
the problem is that the variable value shown is instead 0.48999999999999999 I do not need to display 0.49 using Math.Round() function; I need to exactly store this value.
Thank you.
Decimaltype. However, be warned! Double may "look" bad but it will be far more precise if you're doing lots of calculations with that value. However if you're simply storing it or doing simple add/subtract calculations with it then Decimal will serve you well.