main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
775 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | "use strict";
|
---|
| 2 |
|
---|
| 3 | exports.__esModule = true;
|
---|
| 4 | exports["default"] = void 0;
|
---|
| 5 | var _ramda = require("ramda");
|
---|
| 6 | /**
|
---|
| 7 | * Returns the value of a number rounded to the nearest integer.
|
---|
| 8 | *
|
---|
| 9 | * @func round
|
---|
| 10 | * @memberOf RA
|
---|
| 11 | * @since {@link https://char0n.github.io/ramda-adjunct/2.15.0|v2.15.0}
|
---|
| 12 | * @category Math
|
---|
| 13 | * @sig Number -> Number
|
---|
| 14 | * @param {number} number The number to round
|
---|
| 15 | * @return {number} The value of the given number rounded to the nearest integer
|
---|
| 16 | * @example
|
---|
| 17 | *
|
---|
| 18 | * RA.round(0.9); //=> 1
|
---|
| 19 | * RA.round(5.95); //=> 6
|
---|
| 20 | * RA.round(5.5); //=> 6
|
---|
| 21 | * RA.round(5.05); //=> 5
|
---|
| 22 | * RA.round(-5.05); //=> -5
|
---|
| 23 | * RA.round(-5.5); //=> -5
|
---|
| 24 | * RA.round(-5.95); //=> -6
|
---|
| 25 | */
|
---|
| 26 |
|
---|
| 27 | var round = (0, _ramda.curryN)(1, (0, _ramda.bind)(Math.round, Math));
|
---|
| 28 | var _default = round;
|
---|
| 29 | exports["default"] = _default; |
---|
Note:
See
TracBrowser
for help on using the repository browser.