@newdash/newdash
Version:
javascript/typescript utility library
41 lines (40 loc) • 974 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ceil = void 0;
const createRound_1 = __importDefault(require("./.internal/createRound"));
/**
* @ignore
* @private
* @internal
*/
const internalCeil = (0, createRound_1.default)("ceil");
/**
* Computes `number` rounded up to `precision`.
* (Round up: the smallest integer greater than or equal to a given number.)
*
* @since 5.5.0
* @category Math
* @param number The number to round up.
* @param precision The precision to round up to.
* @returns Returns the rounded up number.
* @example
*
* ```
* ceil(4.006)
* // => 5
*
* ceil(6.004, 2)
* // => 6.01
*
* ceil(6040, -2)
* // => 6100
* ```
*/
function ceil(number, precision = 0) {
return internalCeil(number, precision);
}
exports.ceil = ceil;
exports.default = ceil;