root / HServer / 00.Server / 00.Program / node_modules / lodash / round.js
이력 | 보기 | 이력해설 | 다운로드 (501 Bytes)
1 | 39 | HKM | var createRound = require('./_createRound'); |
---|---|---|---|
2 | |||
3 | /**
|
||
4 | * Computes `number` rounded to `precision`.
|
||
5 | *
|
||
6 | * @static
|
||
7 | * @memberOf _
|
||
8 | * @since 3.10.0
|
||
9 | * @category Math
|
||
10 | * @param {number} number The number to round.
|
||
11 | * @param {number} [precision=0] The precision to round to.
|
||
12 | * @returns {number} Returns the rounded number.
|
||
13 | * @example
|
||
14 | *
|
||
15 | * _.round(4.006);
|
||
16 | * // => 4
|
||
17 | *
|
||
18 | * _.round(4.006, 2);
|
||
19 | * // => 4.01
|
||
20 | *
|
||
21 | * _.round(4060, -2);
|
||
22 | * // => 4100
|
||
23 | */
|
||
24 | var round = createRound('round'); |
||
25 | |||
26 | module.exports = round; |