UNPKG

@utilify/core

Version:

Modern, strongly typed, and safe utility function library for JavaScript and TypeScript. Includes type checking, manipulation of arrays, objects, strings, dates, colors, numbers, regular expressions, and more. Compatible with Browser, Node.js, Deno, and B

9 lines 408 B
/** * Rounds a number to a specified precision. * @param {number} value - The number to round. * @param {number} [precision=0] - The number of decimal places. * @returns {number} The rounded number. * @throws {TypeError} If value or precision is not a number, or precision is negative. */ export default function roundTo(value: number, precision?: number): number; //# sourceMappingURL=roundTo.d.ts.map