UNPKG

slanted-gamedev-toolz

Version:

A slanted mix of tools for your brilliant ideas in game design.

14 lines (13 loc) 545 B
/** * Formats a number with commas as thousands separators. * * @param {number} inputMoney - The number to format. * @param {boolean} [showNegatives=false] - Whether to retain the negative sign for negative numbers. * @returns {string} The formatted number as a string with commas. * * @example * numberWithCommas(1234567); // "1,234,567" * numberWithCommas(-1234567); // "1,234,567" * numberWithCommas(-1234567, true); // "-1,234,567" */ export declare function numberWithCommas(inputMoney: number, showNegatives?: boolean): string;