• <nav id="cwumo"><code id="cwumo"></code></nav>
  • <menu id="cwumo"><strong id="cwumo"></strong></menu>

    JavaScript中用于四舍五入的Math.round方法講解

    時間:2024-11-04 19:28:04 JavaScript 我要投稿
    • 相關推薦

    JavaScript中用于四舍五入的Math.round方法講解

      此方法返回一個數四舍五入為最接近的整數的值。

      語法

      Math.round( x ) ;

      下面是參數的詳細信息:

      x: 一個數字

      返回值:

      返回數字四舍五入為最接近的整數的值。

      例子:

      JavaScript Math round() Method

      這將產生以下結果:

      First Test Value : 1Second Test Value : 21Third Test Value : 20Fourth Test Value : -20

      

    【JavaScript中用于四舍五入的Math.round方法講解】相關文章:

    JavaScript的課堂講解09-03

    詳解JavaScript中的splice()使用方法08-20

    Javascript中arguments對象的詳解和使用方法08-20

    JavaScript常用方法匯總10-25

    JavaScript數組常用方法介紹09-04

    javascript跨域訪問的方法07-09

    javascript編程異常處理的方法08-04

    JavaScript fontcolor方法入門實例07-07

    JavaScript中的with關鍵字07-24

    在Java中執行JavaScript代碼07-14

    日韩激情