mirror of
https://github.com/RomySaputraSihananda/ares.git
synced 2026-07-28 02:57:54 +00:00
9716fc0955
- Linear design system (dark canvas, lavender accent) - Live account stats, open positions, pending orders (30s polling) - Trade history with equity curve chart - Backtest results table - Proxy API routes — MT5_BASE_URL server-side only, never exposed to browser - Deploy on Vercel: set MT5_BASE_URL env var Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
23 lines
619 B
TypeScript
23 lines
619 B
TypeScript
export function formatCurrency(n: number, currency = "USD"): string {
|
|
return new Intl.NumberFormat("en-US", {
|
|
style: "currency", currency,
|
|
minimumFractionDigits: 2,
|
|
maximumFractionDigits: 2,
|
|
}).format(n);
|
|
}
|
|
|
|
export function formatPct(n: number, decimals = 1): string {
|
|
return `${n >= 0 ? "+" : ""}${n.toFixed(decimals)}%`;
|
|
}
|
|
|
|
export function formatDate(iso: string): string {
|
|
return new Date(iso).toLocaleString("en-US", {
|
|
month: "short", day: "numeric",
|
|
hour: "2-digit", minute: "2-digit",
|
|
});
|
|
}
|
|
|
|
export function formatPrice(n: number, digits = 2): string {
|
|
return n.toFixed(digits);
|
|
}
|