everyutil
Version:
A comprehensive library of lightweight, reusable utility functions for JavaScript and TypeScript, designed to streamline common programming tasks such as string manipulation, array processing, date handling, and more.
9 lines (8 loc) • 344 B
TypeScript
/**
* Rounds a number to a given number of decimal places, avoiding floating point errors.
* @author @dailker
* @param {number} n - The number to round.
* @param {number} decimals - The number of decimal places.
* @returns {number} The rounded number.
*/
export declare function preciseRound(n: number, decimals: number): number;