Search found 3 matches

by mrjaybov
Fri Dec 11, 2009 12:27 am
Forum: QBASIC and QB64 Questions & Answers
Topic: VAL function problem
Replies: 6
Views: 17578

burger, You are correct. I changed my code and it corrected my VAL issue. But that brought about another problem, when I do the TOTAL# = TOTAL# + value ---- it returns TOTAL as a Double value, but brings me right back to my original problem that I had. 9889.89 turns into 9889.8896484375 for some rea...
by mrjaybov
Thu Dec 10, 2009 10:15 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: VAL function problem
Replies: 6
Views: 17578

I am pulling the number from a comma delimited file by using the MID$ command, AMT$ = MID$(data$,2,7) then all I do is add it to a totals variable like this: Total# = Total# + VAL(AMT$). Funny thing is, it only happens once in a while, there's no rhyme or reason. When I print out the string AMT$ it ...
by mrjaybov
Thu Dec 10, 2009 5:20 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: VAL function problem
Replies: 6
Views: 17578

VAL function problem

I have a string that equals 9889.98 when I use the VAL function to convert it to a number I get 9889.979999999 Why is that? I'm converting lots of numbers this way and I always get one or two that does this.. It's throwing my totals off.