Download src/utils/formatNumber.ts from nolual/majic: direct link, hf CLI and curl.
- Browser
- Download file 262 Bytes
-
https://huggingface.co/nolual/majic/resolve/main/src/utils/formatNumber.ts
- Command line
-
hf download hf://nolual/majic/src/utils/formatNumber.ts
-
curl -L -o formatNumber.ts https://huggingface.co/nolual/majic/resolve/main/src/utils/formatNumber.ts
262 Bytes
| export function replaceCommaWithPeriod(input: string): string { | |
| return input.replace(/,/g, "."); | |
| } | |
| export function formatNumber(number: number): string { | |
| return replaceCommaWithPeriod( | |
| number.toLocaleString("en-US", { maximumFractionDigits: 0 }) | |
| ); | |
| } | |