<html>
<body>
<input type="text" id="txt1" value="10.25">
<input type="text" id="txt2">
<input type="button" value="少数点以下を繰り上げる" onclick="document.all.txt2.value = Math.ceil(document.all.txt1.value)">
<input type="button" value="少数点以下を繰り下げる" onclick="document.all.txt2.value = Math.floor(document.all.txt1.value)">
</body>
</html>
|