Formify Docs

Currency

Format numeric values as currency

Currency

The currency formatter renders a numeric value with thousands grouping and a configurable symbol and decimals.

Options

OptionTypeDefaultDescription
symbolstring"$"Currency symbol, e.g. "€", "₹"
decimalsnumber2Number of decimal places
groupstring","Thousands separator
decimalstring"."Decimal separator

Usage

validationSchema: {
  price: { format: { type: "currency", trigger: "onBlur" } },
}

Result

InputResult
12345.67$12,345.67

Things to know

  • Currency is usually formatted on "onBlur" — typing a formatted value is jarring.
  • Pair with the decimal or numeric validator for validation.

On this page