14 lines
439 B
TypeScript
14 lines
439 B
TypeScript
import { clsx, type ClassValue } from "clsx";
|
|
import { twMerge } from "tailwind-merge";
|
|
|
|
export function cn(...inputs: ClassValue[]) {
|
|
return twMerge(clsx(inputs));
|
|
}
|
|
|
|
export const formatNumber = (value: string | number) => {
|
|
// if (!value) return "0";
|
|
const numericValue = typeof value === "string" ? parseFloat(value) : value;
|
|
if (isNaN(numericValue)) return "0";
|
|
return new Intl.NumberFormat("fa-IR").format(numericValue);
|
|
};
|