Multiplication

K

Ken

Here's my code:

Dim intProduct as Integer
intProduct = (69 * 0.0254)

The correct answer is 1.7526. However, intProduct = 2. What do I need to
do to get the correct answer? Thanks.
 
D

Duane Hookom

Integer doesn't have a decimal portion. If you need decimal places, Dim as
double, single, or decimal.

Dim dblProduct as Double
dblProduct = (69 * 0.0254)
 
Top