/** * Composable function wrappers for building regional logic variants. * * Usage pattern (compose left-to-right, innermost runs first): * formatAmount = withTaxLabel("inc. VAT")(withCurrencySymbol("£")(baseFormatAmount)) * // calling formatAmount(99) → "£99 inc. VAT" */ /** Prepend a currency symbol to the output of a formatter. */ export const withCurrencySymbol = (symbol: string) => (fn: (n: number) => string) => (n: number): string => `${symbol}${fn(n)}` /** Append a tax/label string to the output of a formatter. */ export const withTaxLabel = (label: string) => (fn: (n: number) => string) => (n: number): string => `${fn(n)} ${label}`