docs: improve landing page start counter

This commit is contained in:
KinfeMichael Tariku
2024-11-07 10:24:47 +03:00
committed by GitHub
parent b090cd033d
commit 60ef589cda
6 changed files with 58 additions and 17 deletions

View File

@@ -7,3 +7,8 @@ export function cn(...inputs: ClassValue[]) {
export function absoluteUrl(path: string) {
return `${process.env.NEXT_PUBLIC_APP_URL}${path}`;
}
export function kFormatter(num: number) {
return Math.abs(num) > 999
? Math.sign(num) * parseFloat((Math.abs(num) / 1000).toFixed(1)) + "k"
: Math.sign(num) * Math.abs(num);
}