There is the possibility of small amounts of error when dealing with
singles/doubles as they are estimations not exact values
There are really 3 options ..
1) use Math.Round to convert the value
2) use a lossless number format (i.e. BigDecimal) which operates on strings
or a fraction class
http://geekswithblogs.net/gyoung/arc.../01/76869.aspx includes
links to both
3) it seems like you might be doing monetary calculations here ... a common
pattern is to not treat things as "Dollars" but to put the value in an
integer representing pennies ... this is much faster for calculations as
well.
"Tor Aadnevik" <to**********@Intellifield.no> wrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
Hi,
I have a problem converting values from Single to double.
eg. When the Single value 12.19 is converted to double, the result is
12.1899995803833.
Anyone know how to avoid this?
Regards Totto