UNPKG

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) 358 B
/** * Converts a decimal number to its simplest fractional form. * For example, decimalToFraction(0.75) returns [3, 4]. * @author @dailker * @param {number} n - The decimal number to convert. * @returns {[number, number]} The numerator and denominator of the fraction. */ export declare function decimalToFraction(n: number): [number, number];