@monstermann/fn
Version:
A utility library for TypeScript.
24 lines • 587 B
TypeScript
//#region src/number/toFixed.d.ts
/**
* `toFixed(target, length)`
*
* Returns a string representation of `target` formatted with exactly `length` digits after the decimal point.
*
* ```ts
* toFixed(3.14159, 2); // "3.14"
* toFixed(42, 3); // "42.000"
* toFixed(1.005, 2); // "1.01"
* ```
*
* ```ts
* pipe(3.14159, toFixed(2)); // "3.14"
* pipe(42, toFixed(3)); // "42.000"
* pipe(1.005, toFixed(2)); // "1.01"
* ```
*/
declare const toFixed: {
(length: number): (target: number) => string;
(target: number, length: number): string;
};
//#endregion
export { toFixed };