directus-extension-currency-cents-interface
v1.0.0
Published
Directus interface for storing currency as integer cents while editing as 2-decimal amounts
Maintainers
Readme
Currency Cents Interface
A Directus interface extension that stores values as integer cents while presenting a 2-decimal currency amount in the editor.
Behavior
- Stored value:
12345 - Editor input:
123.45 - Preview: formatted with the configured locale and currency code
Options
currency: ISO 4217 currency code, defaults toUSDlocale: locale used for formatting, defaults toen-US
Development
npm install
npm run buildFor local development:
npm run devUsage
Assign the interface to an integer or bigInteger field in Directus.
Docker Mount
Mount the extension directory into Directus using the package name:
services:
directus:
volumes:
- ./directus-extension-currency-cents-interface:/directus/extensions/directus-extension-currency-cents-interface