@web3r/flowerkit
Version:
A collection of more than 60 often used utility JS functions that simplify frontend development.
13 lines • 452 B
TypeScript
/**
* Gets a string with leading zero
* @param num{Number} - source number
* @param digits{Number=} - number of digits in target string
* @return {string}
* @example
* // How to add a leading zero to a number?
* const num = 9;
* const withZero = getStrWithZeroFromNumber(9, 3);
* console.log(withZero); // => "009"
*/
export function getStrWithZeroFromNum(num: number, digits?: number | undefined): string;
//# sourceMappingURL=index.d.ts.map