Money Fields

Money fields give you a text input tailored for storing currency amounts.

# Settings

Money fields have the following settings:

  • Currency – The currency in which values should be stored.
  • Default Value – The default value that should be applied for new elements.
  • Min Value – The lowest amount that may be entered in the field.
  • Max Value – The highest amount that may be entered in the field.
  • Show Currency – Whether to display the currency label with the field’s text input.
  • Size – The input’s size attribute.

# Development

# Working with Money Field Data

If you have an element with a Money field in your template, you can output its value using the money filter, or craft\helpers\MoneyHelper::toString() (opens new window).

{% set value = entry.myFieldHandle|money %}

That will give you a formatted currency value for the field, if it has a value.