@cesarechazu/directus-extension-decimal-input
v1.0.3
Published
Locale-aware decimal input for Directus numeric fields.
Downloads
389
Maintainers
Readme
Decimal Input
Locale-aware numeric input interface for Directus numeric fields.
It stores a normalized decimal value and formats the visible value using the browser locale when the field loses focus.
Demo
Features
- Accepts
.or,while typing - Formats on
blurusing the browser locale - Stores a normalized decimal value
- Supports min/max range validation
- Supports configurable minimum and maximum decimals
- Supports left and right icons
- Supports font presets: Sans serif, Serif, Monospace
Options
minimum_value: minimum allowed numeric valuemaximum_value: maximum allowed numeric valueminimum_decimals: minimum visible decimalsmaximum_decimals: maximum decimals used for roundingicon_left: icon displayed at the left side of the inputicon_right: icon displayed at the right side of the inputfont: font preset for the input text
Behavior
- While typing, the user can enter the value freely.
- When the field loses focus, the value is formatted using the browser locale.
- The stored value remains normalized.
- Rounding is applied according to
maximum_decimals.
