export interface Budget { name: string target: number buffer?: number spent: number } export interface Bucket { name: string target: number saved: number } export interface Transaction { description: string budget: string amount: number } const currencyFormat = new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD', maximumFractionDigits: 2, minimumFractionDigits: 2, }) export function currency(amount: number): string { return currencyFormat.format(amount) } const percentageFormat = new Intl.NumberFormat('en-US', { currency: 'USD', maximumFractionDigits: 2, }) export function percentage(ratio: number): string { return percentageFormat.format(ratio * 100) + '%' }