so 4 / 100 = 0? how could i..

 

make a point decimal from two integers?


ive got two integer variables

iMultiplier 100 or 10000

and

iRange 4


i was hoping to divide the iRange by the iMultiplier to get the decimal of the price to add

or subtract from a price but what was happening is 0 and not 0.04..


just try

Print(4/100); the answer is 0

oh yea and also try Print(NormalizeDouble(4/100,2));

 
Subgenius:

just try

Print(4/100); the answer is 0

oh yea and also try Print(NormalizeDouble(4/100,2));

It is because the result is cast to an integer

try

4/100.0

so that 1 of the numbers is a double 

 
GumRai:

It is because the result is cast to an integer

try

4/100.0


thx

Reason: