/** * Limit decimals of a floating number to specified length. The length depends on * `decimals` which can have the following settings (n = integer): * * Char | Description * ----- | ------------- * **>n** | Minimum number of decimals, if the current number of decimals are shorter than the defined length, extra 0 (zeros) will be added. * ** 123.46 * limitDecimals(123, 5) // -> 123.00000 * * // Max number of decimals * limitDecimals(123.4567, '<3') // -> 123.457 * limitDecimals(123, '<3') // -> 123 * * // Min number decimals * limitDecimals(123.4, '>4') // -> 123.4000 * limitDecimals(123.456789, '>4') // -> 123.456789 * ``` * * @param num - Number to limit the decimals on * @param decimals - Setting for how to handle the decimals * @return - String representation of the number with the decimals adjusted according to the decimal setting */ export default function limitDecimals(num: number, decimals?: number | string): string;