...

View Full Version : decimal delima



Jason
04-27-2004, 01:50 AM
input = .2



var check = (input/2) * .001;

check = .1


this doesn't give me the proper answer cause if I have input = to .2 then the answer I get is .1 when it should be .0001
any help?


Jason

dswimboy
04-27-2004, 03:49 AM
var input = .2;
var check = (input/2) * .001;
document.write(check);
works dandy on my machine. are you sure you aren't modifying the variable anywhere else in the script?

sad69
04-27-2004, 06:37 PM
I don't know if it matters, but try changing .2 to 0.2 and likewise .001 to 0.001

Sadiq.

dswimboy
04-28-2004, 03:37 AM
var input = 0.2;
var check = (input/2) * 0.001;
document.write(check);
still get .0001



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum