[求助]一个运算中的问题请指教。我很急的啊!`哪位可以帮我啊!~~
`<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>只能算加、减、乘、除整数的计算器</title>
<script language="javascript">
function shi(form1)
{
var sum1=parseInt(form1.a.value)
var sum2=parseInt(form1.b.value)
if (form1.sdh.value=="+")
form1.c.value=sum1+sum2
if (form1.sdh.value=="-")
form1.c.value=sum1-sum2
if (form1.sdh.value=="*")
form1.c.value=sum1*sum2
if (form1.sdh.value=="/")
form1.c.value=sum1/sum2
}
</script>
</head>
<body>
<form name="form1" method="post" action="">
<input name="a" type="text" id="a" size="8">
<select name="sdh" id="sdh">
<option value="+">+</option>
<option value="-">-</option>
<option value="*">*</option>
<option value="/">/</option>
</select>
<input name="b" type="text" id="b" size="8">
<input type="button" name="Submit2" value="=" onclick="return shi(this.form)">
<input name="c" type="text" id="c" size="8">
</form>
</body>
</html>
为什么我只能运算整数呢?
而小数点我却运算不起来呢?
哪位大侠可以教教我啊?