Download the PHP package builtnoble/currency-fieldtype without Composer
On this page you can find all versions of the php package builtnoble/currency-fieldtype. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download builtnoble/currency-fieldtype
More information about builtnoble/currency-fieldtype
Files in builtnoble/currency-fieldtype
Package currency-fieldtype
Short Description A Statamic fieldtype for storing and displaying monetary values as locale-aware, precision-safe integer subunits.
License MIT
Informations about the package currency-fieldtype
Currency Fieldtype
A Statamic fieldtype for storing and displaying monetary values. Values are saved as integers in the smallest currency unit (e.g. cents for USD), formatted for display using the current site locale, and fully configurable per field via ISO currency code.
Features
- Integer subunit storage — values are saved as raw integers (e.g.
123456for $1,234.56), avoiding floating point precision issues - Locale-aware formatting — display formatting (symbol, separators, decimal places) follows the current Statamic site locale automatically
- ISO currency configuration — choose any supported currency (USD, EUR, GBP, etc.) from a searchable select field in the Control Panel, with the correct symbol and decimal precision applied automatically
- Antlers ready — augmented values are returned as a formatted currency string (e.g.
$1,234.56) ready to output in your templates - Null-safe — null values are formatted as zero on display (
$0.00) and returnnullfrom the index processor, keeping collection listings clean - Stable sorting behavior — index values are converted to sortable integers, with explicit null sorting behavior for ascending and descending order
- Config metadata for Vue — preload data includes currency, locale, precision, and symbol so the CP field UI has everything it needs
- Negative amounts: a leading minus sign is preserved through input, storage, and display, so refunds, discounts, and other negative adjustments are supported
Requirements
- PHP 8.3+
- Statamic 6.0+
- PHP's
intlextension, which Laravel'sNumber::currency()relies on for locale-aware formatting.
How to Install
Install the addon via Composer:
Then add the fieldtype to any blueprint in the Control Panel or directly in resources/blueprints/.
Documentation
See DOCUMENTATION.md for configuration options and a full explanation of how the fieldtype works internally.
Development
See CONTRIBUTING.md for the full development setup and workflow.