Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Currency Field Type

Security covered Maintenance fixes only 4 sites

Part of the Currency ecosystem · 6 projects

This module provides a field type for storing currency information based on the ISO 4217 standard. It allows editors to select currencies from a predefined list, ensuring accuracy and consistency, and includes support for withdrawn currencies.

A field type for currencies, following ISO 4217. Add it to any entity and editors pick a currency from a list of every current code in the standard, rather than typing one into a plain text field and hoping.

The module is small and feature-complete. It does one thing, has no dependencies beyond Drupal core, and is maintained for fixes rather than new features.

Features

  • A currency_field field type, with a select widget and a formatter, available on any fieldable entity. The field stores the alphabetic code, such as EUR.
  • The complete ISO 4217 list bundled as data — alphabetic code, numeric code, currency name, issuing entity, and minor unit — so there is no API call and no external service to depend on. It is generated from the lists published by SIX, the ISO 4217 maintenance agency, and is current to the September 2026 list.
  • Values are validated against the list. Withdrawn currencies carry their withdrawal date and stay valid, so historical records still save; the widget offers only current currencies for new values.
  • The widget can label options by code, currency name or country, and the formatter can show any of the three.

Requirements

Drupal 10.3 or later, Drupal 11 or Drupal 12. Nothing else.

Installation

composer require drupal/currency_field, then enable the module. See Installing modules for the longer version.

Usage

Add a field of type Currency to any entity bundle through Manage fields, and choose how the widget labels its options in the field settings. The Currency widget is used on Manage form display. On Manage display, set the Currency formatter to show the code, the currency name or the country name.

Full documentation: project.pages.drupalcode.org/currency_field.

For developers

Two helpers are available if you need the currency data outside a field:

  • currency_field_currencies() returns the full decoded list.
  • currency_field_currency_options() returns an options array, keyed and labelled by whichever columns you ask for — AlphabeticCode, NumericCode, Currency, Entity, MinorUnit or WithdrawalDate — with or without withdrawn currencies.

The data lives in currencies.yml and is regenerated from the SIX lists by scripts/update-currencies.php. Issues and merge requests for data corrections are welcome.

Used by

GTFS Core uses it in its GTFS Fares submodule to store fare product prices. It is not specific to that use — it is a general-purpose field.

How this module is built

Changes to this module since 2026 were drafted with an AI coding assistant (Claude Code). The maintainers review, test and take responsibility for every change, and the tests and code checks run on drupal.org's CI. Contributions follow Drupal's policy on the use of AI when contributing.

Supporting this module

Developed and maintained by Tyler Brown Cifu Shuster of FivePaths, LLC. Development sponsored by FivePaths and the San Francisco Municipal Transportation Agency.

Drupal 10–11

Ask your assistant about Currency Field Type

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
4
Tracked since
Jun 2024
Latest release
1 month ago
Releases (12 mo)
3 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Core PHP Release date
2.1.1 Stable 10–11 Oct 20, 2026
2.1.0 Stable 10–11 Oct 9, 2026
2.0.0 Stable 8–11 Aug 18, 2026
2.0.x-dev Dev 8–11 Jun 27, 2024