Add documentation to formatDecimal function

This commit is contained in:
Koen Vlaswinkel
2022-09-21 12:16:37 +02:00
parent 4518d9a81d
commit 8da1a28478

View File

@@ -4,6 +4,12 @@
const numberFormatter = new Intl.NumberFormat('en-US');
/**
* Formats a number to be human-readable with decimal places and thousands separators.
*
* @param value The number to format.
* @returns The formatted number. For example, "10,000", "1,000,000", or "1,000,000,000".
*/
export function formatDecimal(value: number): string {
return numberFormatter.format(value);
}