formatCurrency
Formats a number as a currency string, adding a currency symbol if specified.> formatCurrency({ amount, currency = "" }: FormatCurrencyParams): string
- amount: The amount to format.
- currency: An optional currency symbol to prepend.
- Returns: The formatted currency string.
Example
import { formatCurrency } from "@explita/daily-toolset";
formatCurrency({ amount: 1234.56, currency: "$" }); // "$1,234.56"