10 lines
210 B
TypeScript
10 lines
210 B
TypeScript
/**
|
|
* Formats a number without trailing zeros.
|
|
*
|
|
* @param num the number to format
|
|
* @returns the formatted number
|
|
*/
|
|
export function formatNumberWithCommas(num: number) {
|
|
return num.toLocaleString();
|
|
}
|