Support fractions, with new field type, widget and formatter

Created on 8 July 2025, 3 days ago

Problem/Motivation

Following my suggestion in 📌 Support decimals with new field type, widget and formatter Active , I noticed that it may be useful to store fractions for a more precise accounting of ownership shares, so I'm going to add another field type and corresponding autocomplete and select list widgets and label formatter that I hope can be included in the module (or sub-module).

The new "Entity reference w/fraction" field will have a fraction component instead of quantity, which is actually two parts, numerator and denominator, both tiny int unsigned, with additional field settings to set a maximum per field item and/or for the sum of items, as well as a checkbox to set equal values to all items automatically (if left empty but with a target_id). The formatter has a "Fraction separator" option which defaults to "/" to render num/den, on top of the usual position and template settings.

📌 Task
Status

Active

Version

2.0

Component

Code

Created by

🇮🇹Italy kopeboy Milan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024