Math.floor

書式

Math.floor(値)

説明

小数値以下を切り捨てます。1.98であれば1になります。

サンプルコード [実行]

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>Sample</title>
</head>
<body>
<script type="text/javascript"><!--
document.write(Math.floor(19.69));
// --></script>
</body>
</html>