2024-09-08 21:35:32 +00:00
|
|
|
/**
|
|
|
|
* Formats a number without trailing zeros.
|
|
|
|
*
|
|
|
|
* @param num the number to format
|
|
|
|
* @returns the formatted number
|
|
|
|
*/
|
|
|
|
export function formatNumberWithCommas(num: number) {
|
|
|
|
return num.toLocaleString();
|
|
|
|
}
|
2024-09-27 20:19:44 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Formats the pp value
|
|
|
|
*
|
|
|
|
* @param num the pp to format
|
|
|
|
* @returns the formatted pp
|
|
|
|
*/
|
|
|
|
export function formatPp(num: number) {
|
|
|
|
return num.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
|
|
|
}
|