This double: 16.8999999
after theDouble = Math.Round(theDouble, 1) it shows up in the debugger as 16.9 but in the UI later on it’s NOT 16.9 but 16.899999.
Why is this so?
I am developing a WP7 application and however and whenever I round a certain value, it always shows up “derounded” in the UI. I have even tried to make one last round before assigning the array to the listbox’s itemssource. It’s really strange and I’d appreciate any help or explanation.
I have even tried to assign a value myself just before the itemssource gets set. I assign 16.89999 and round it using the above method. In the debugger I get the expected result but then in the UI I get another result, namely, 16.899999618. Help?
I have no idea but it could have something to do with how WP7 presents doubles in datacontexts. I changed the type to float and now it works perfectly. I hope someone in the same situation finds this question even though it’s pretty downvoted.