Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27513

Math.Round not rounding to correct amount

$
0
0
Please refer to the following - does anyone know why this is not rounding up the second decimal place? The correct result shoudl be 2059.43.

Dim tempVFD, amount, exch As Double

amount = 2025
exch = 1.017
TempVFD = amount * exch ' returns 2059.4249999999997
tempVFD = Round(tempVFD, 2) ' returns 2059.42
MsgBox(test.ToString("0.00"))

What am I missing?

Thanks in advance

Viewing all articles
Browse latest Browse all 27513

Trending Articles



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