A free, open, self-hosted app platform (GNU AGPLv3): one-click app deploys, Traefik reverse proxy with automatic SSL, rootless Docker support, gluetun VPN routing, and a web dashboard to manage it all. Free & open forever to self-host; optional paid hosted services fund it. See PROMISE.md. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: librelad <librelad@digitalangels.vip>
25 lines
608 B
TypeScript
25 lines
608 B
TypeScript
import { clsx, type ClassValue } from "clsx";
|
|
import { twMerge } from "tailwind-merge";
|
|
|
|
export function cn(...inputs: ClassValue[]) {
|
|
return twMerge(clsx(inputs));
|
|
}
|
|
|
|
export function formatMoney(
|
|
amountMinor: number,
|
|
currency: string = "GBP",
|
|
locale: string = "en-GB",
|
|
): string {
|
|
return new Intl.NumberFormat(locale, {
|
|
style: "currency",
|
|
currency,
|
|
}).format(amountMinor / 100);
|
|
}
|
|
|
|
export function parseMoney(input: string): number {
|
|
const cleaned = input.replace(/[^\d.\-]/g, "");
|
|
const value = parseFloat(cleaned);
|
|
if (isNaN(value)) return 0;
|
|
return Math.round(value * 100);
|
|
}
|