[TSM.ID].[11031972] PXE : Platform X Ecosystem I [118 Module -LIVE-]

This commit is contained in:
TSM.ID
2026-05-25 03:50:05 +07:00
commit e820143b3c
673 changed files with 101320 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
export type Currency = 'Rp' | 'USD' | 'Crypto';
export function formatCurrency(amountUSD: number, currency: Currency): string {
if (currency === 'USD') {
return new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }).format(amountUSD);
} else if (currency === 'Rp') {
// 1 USD = 16000 Rp (Simulation)
return new Intl.NumberFormat('id-ID', { style: 'currency', currency: 'IDR' }).format(amountUSD * 16000);
} else if (currency === 'Crypto') {
// 1 USD = 1 USDT
return `${amountUSD.toFixed(2)} USDT`;
}
return amountUSD.toString();
}