#!/usr/bin/env python3 """ Script to replace inline formatCurrency functions with shared formatter utilities """ import re import sys files_to_update = [ "/home/alex/.local/src/homepage/src/routes/cospend/+page.svelte", "/home/alex/.local/src/homepage/src/routes/cospend/payments/+page.svelte", "/home/alex/.local/src/homepage/src/routes/cospend/payments/view/[id]/+page.svelte", "/home/alex/.local/src/homepage/src/routes/cospend/recurring/+page.svelte", "/home/alex/.local/src/homepage/src/routes/cospend/settle/+page.svelte", ] def process_file(filepath): print(f"Processing: {filepath}") try: with open(filepath, 'r', encoding='utf-8') as f: content = f.read() original_content = content # Check if already has the import has_formatter_import = 'from \'$lib/utils/formatters\'' in content or 'from "$lib/utils/formatters"' in content # Find the