英[fl?:(r)] US[fl?r, flor]

n. 床; 地面、床; 底; 議會席

vt. 床; 敗北、ノックダウン

三人稱単數(shù):floors 複數(shù)形:floors 現(xiàn)在分詞:flooring 過去形:floored 過去分詞:floored

javascript floor()方法 構文

関數(shù): 數(shù)値を切り捨てます。

#構文: Math.floor(x)

パラメータ: #xx 必須。任意の數(shù)値または式。

戻り値:

x 以下で、x に最も近い整數(shù)。

説明:

floor() メソッドは切り捨て計算を?qū)g行し、関數(shù)パラメーター以下の最も近い整數(shù)を返します。

javascript floor()方法 例

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script type="text/javascript">
//在不同的數(shù)字上使用 floor() 方法
    document.write(Math.floor(0.60) + "<br />")
    document.write(Math.floor(0.40) + "<br />")
    document.write(Math.floor(5) + "<br />")
    document.write(Math.floor(5.1) + "<br />")
    document.write(Math.floor(-5.1) + "<br />")
    document.write(Math.floor(-5.9))

</script>

</body>
</html>

インスタンスの実行 ?

[インスタンスの実行] ボタンをクリックしてオンライン インスタンスを表示します