float_factor
The float_factor widget shows a stored float multiplied by a constant, and divides the user's input back down when saving. It is how you display a ratio as a percentage without changing what the database holds.
| Technical name | float_factor |
|---|---|
| Field types | float |
| Views | form, list |
| Module | web, present in every Odoo database |
| Used in core | 0 uses in Odoo 19 Community or Enterprise. It exists for custom views and third-party modules. |
| Versions | Odoo 19.0, Odoo 20.0 |
| No-code setup | No. There is no Studio entry for this widget. |
| Alternatives | percentage, float, float_toggle, float_time |
What the float_factor widget does
What this means for your team
Supported options in Odoo 19
| Option | Type | What it does |
|---|---|---|
factor | number | The multiplier applied to the stored value for display, and divided back out when the user saves. A factor of 100 shows a stored 0.35 as 35. Leaving it out gives you a plain float field, because the component's default props set it to 1.(default: 1) |
Watch the interaction between factor and digits. Rounding is applied to the scaled display value, not to the stored one. A stored 0.33333 with factor 100 and two digits shows 33.33, but the database still holds the long value. If a user does not retype the field, that precision survives, and a later export will not match what they saw.
Working examples
Version compatibility
| Version | Status | Notes |
|---|---|---|
| Odoo 19.0 | Verified | Verified against the shipped 19.0 source. |
| Odoo 20.0 | Verified | Verified against the 20.0 branch. No changes. |
Stable across both branches we checked.
What is changing in Odoo 20
Common problems and fixes
| Symptom | Cause and fix |
|---|---|
| The widget shows the raw stored number, unscaled | factor was not passed, so it defaulted to 1. Add options="{'factor': 100}" or whatever multiplier you need. |
| Exports and reports disagree with the form | Working as designed. The widget scales the display only; the stored value is unchanged and that is what reports read. Add a stored computed field holding the scaled value if reports need it, or scale in the report itself. |
| A value looks rounded on screen but comes back long in an export | digits rounds the displayed value, not the stored one. Round server-side in the field definition if the stored precision matters. |
Float_factor widget vs the alternatives
| Widget | Best for | Key difference |
|---|---|---|
float_factor | Showing a stored float in a different unit | Multiplies for display and divides on save, leaving the database untouched |
| percentage | A ratio shown as a percentage with the sign | Fixed to percent, and renders the symbol for you |
| float | A plain float with no scaling | Shows the stored value as is |
| float_toggle | Cycling a float between a few fixed values on click | Also takes a factor, but the user clicks rather than types |
| float_time | A float that represents a duration | Renders as hours and minutes rather than a scaled decimal |
Frequently asked questions
How do I show a decimal as a percentage in Odoo?+
Does float_factor change the value stored in the database?+
What is the default factor?+
Can I use digits with float_factor?+
Numbers that read differently in Odoo than in your reports?
Display widgets scale what people see, never what reporting reads, and that gap is where month-end arguments start. We make the stored model match how your team actually talks about the number, so the form, the export and the dashboard agree.
Book a free consultation