mega-plant/lib/utils.ts

20 lines
500 B
TypeScript

import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
export const ZAR = (n: number) =>
new Intl.NumberFormat("en-ZA", {
style: "currency",
currency: "ZAR",
maximumFractionDigits: 0,
}).format(n || 0);
export const ZAR2 = (n: number) =>
new Intl.NumberFormat("en-ZA", {
style: "currency",
currency: "ZAR",
maximumFractionDigits: 2,
}).format(n || 0);