ramda-adjunct
Version:
Ramda Adjunct is the most popular and most comprehensive set of utilities for use with Ramda, providing a variety of useful, well tested functions with excellent documentation.
34 lines (29 loc) • 953 B
JavaScript
;
exports.__esModule = true;
exports["default"] = void 0;
var _ramda = require("ramda");
var _curry = _interopRequireDefault(require("ramda/src/internal/_curry1"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
/**
* Returns the value of a number rounded to the nearest integer.
*
* @func round
* @memberOf RA
* @since {@link https://char0n.github.io/ramda-adjunct/2.15.0|v2.15.0}
* @category Math
* @sig Number -> Number
* @param {number} number The number to round
* @return {number} The value of the given number rounded to the nearest integer
* @example
*
* RA.round(0.9); //=> 1
* RA.round(5.95); //=> 6
* RA.round(5.5); //=> 6
* RA.round(5.05); //=> 5
* RA.round(-5.05); //=> -5
* RA.round(-5.5); //=> -5
* RA.round(-5.95); //=> -6
*/
var round = (0, _curry["default"])((0, _ramda.bind)(Math.round, Math));
var _default = round;
exports["default"] = _default;