floor
依赖
import createRound from './.internal/createRound.js';源码
/**
* 根据 precision(精度) 向下舍入 number。
*
* @since 3.10.0
* @category Math
* @param {number} number 要向下舍入的值。
* @param {number} [precision=0] 向下舍入的精度。
* @returns {number} 返回向下舍入的值。
* @example
*
* floor(4.006)
* // => 4
*
* floor(0.046, 2)
* // => 0.04
*
* floor(4060, -2)
* // => 4000
*/
const floor = createRound('floor');原理
相关链接
Last updated