The problem is that if I need to change one of those values - ex: 0.1 to
0.2 VS2012 autocorrects to 0.20000000000000001!
The last time I had to make changes to this code was with VS2010 and the values in the array if changed they kept their format as writen - ex: if I changed 0.1 to
0.2 it would not autocorrect and maintain the new value as
0.2
L.A.M.
Member
107 Points
48 Posts
System floating point
Nov 25, 2012 08:53 PM|LINK
Hi,
I have a decimal array that was working fine in VS2010 and now VS2012 keeps reformating what I write in code.
Before:
Dim wrk003() As Decimal ... wrk003 = New Decimal() {0.0, 0.8, 2.0}And now it keeps rewriting like this:
Dim wrk003() As Decimal ... wrk003 = New Decimal() {0.0, 0.80000000000000004, 2.0}Is there a way to declare in the page directive or something else so that these decimals maintain a single decimal digit like 0.8?
Thanks.
chjones2008
Member
258 Points
168 Posts
Re: System floating point
Nov 25, 2012 09:13 PM|LINK
how about instead of using Decimal array try a float array?
Something like this
now each array index of result will be able to handle decimal point precision.
L.A.M.
Member
107 Points
48 Posts
Re: System floating point
Nov 25, 2012 11:21 PM|LINK
Sorry that won't solve it...
The problem is that if I need to change one of those values - ex: 0.1 to 0.2 VS2012 autocorrects to 0.20000000000000001!
The last time I had to make changes to this code was with VS2010 and the values in the array if changed they kept their format as writen - ex: if I changed 0.1 to 0.2 it would not autocorrect and maintain the new value as 0.2
I just don't get it?!
maheswari.bo...
Participant
1265 Points
247 Posts
Re: System floating point
Nov 26, 2012 04:59 AM|LINK
Hi,
U can use formats as folloes.
Hopes Helps U.