Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21863

subtracting decimals - what am i missing?!

$
0
0
Hi, i'm sure this is really simple, but i'm having trouble!

All i want to do is to subtract one decimal value from the other, this is basically my code:

Dim myDec1 as double
Dim myDec2 as double
Dim myAnser as double

mydec1= 262.672
mydec2= 262.67

myAnswer = mydec1 - mydec2

However, "myAnswer" does not equal 0.002 as i would expect. I'm getting a value of 2.00000000000955-E3 as a result. What am i doing wrong?!

Viewing all articles
Browse latest Browse all 21863

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>