float
Every decimal number in Odoo passes through the float widget. Its option panel hides a naming trap, and since 19.0 the input quietly evaluates math. Here is the full, source-verified picture.
| Studio name | Decimal |
|---|---|
| Technical name | float |
| Field types | float, monetary |
| Views | form, list, kanban (default widget for float fields everywhere) |
| Module | web, present in every Odoo database |
| Used in core | 7 explicit occurrences across hr_holidays, project, crm; implicitly it renders every float field in every database |
| Versions | Odoo 20.0, Odoo 19.0, Odoo 18.0, Odoo 17.0, Odoo 16.0 |
| No-code setup | Yes: Studio's Decimal field uses this widget by default |
| Alternatives | monetary, percentage, float_time, progressbar |
What the Float field does
What this means for your team
Setting it up in Odoo Studio (no code)
What Studio cannot do here
Supported options in Odoo 19
| Option | Type | What it does |
|---|---|---|
digits | array [width, decimals] | Display precision, e.g. [16, 3] for three decimals. Also accepted as a digits attribute on the field element; the attribute takes precedence over the option. |
min_display_digits | number | Minimum digits kept when formatting. Declared in the options panel as minDigits, but extractProps reads only this snake_case name; the declared name is ignored. |
enable_formatting | boolean | Set false to bypass locale formatting entirely: no thousand separators, no digit padding, raw value in and out.(default: true) |
hide_trailing_zeros | boolean | Trims zeros right of the last significant decimal, so 1.20 renders 1.2. Pairs well with min_display_digits.(since Odoo 19.0) |
human_readable | boolean | Compact display for large numbers (500,000,000,000 renders as 500G). The exact value returns while the input has focus. |
decimals | number | Decimal places used by the compact human_readable format only; ignored without it.(default: 0) |
type | string | Set to "number" for a native HTML number input. Disables locale formatting while editing and the =expression math input.(default: text) |
step | number | Spinner increment for the native input; only meaningful together with type: "number". |
The minimum-digits option is broken as declared. The options panel metadata declares minDigits, but extractProps only reads options.min_display_digits. Write min_display_digits in your XML; the declared camelCase name is silently ignored. The same file also shows digits accepted from two places, and the source comments call this out as historical debt: when both the digits attribute and the digits option are present, the attribute wins.
Working examples
The input is a calculator since Odoo 19
Version compatibility
| Version | Status | Notes |
|---|---|---|
| Odoo 20.0 | In development | Not released. Options and behavior unchanged in the development branch; internals rewritten. See below. |
| Odoo 19.0 | Verified | Adds hide_trailing_zeros, monetary type support and relative math input; drops the placeholder attribute. Verified against the shipped source. |
| Odoo 18.0 | Verified | Same core options minus hide_trailing_zeros; float type only; placeholder attribute still rendered. |
| Odoo 17.0 | Verified | Widget present with the same registration; option set close to 18.0. |
| Odoo 16.0 | Verified | Widget present; registered directly as a component class in the pre-descriptor style, without options panel metadata. |
Upgrade note for 18 to 19. Three changes matter: placeholder attributes on float fields stop rendering, the widget starts accepting monetary fields, and empty-value detection changed from "never empty" to a false-check, which affects list-view empty-cell styling. Option names you already use carry over unchanged.
What is changing in Odoo 20
Common problems and fixes
| Symptom | Cause and fix |
|---|---|
| min_display_digits seems to do nothing | It was written as minDigits, the name the options panel declares but the code never reads. Use min_display_digits in the options dict. |
| Digits option ignored | A digits attribute is also set on the field element, and the attribute wins. Keep one source of precision; prefer the attribute or remove it. |
| The displayed value differs from exports and computations | Widget digits control display only; the database stores the field's full precision. Align the field's decimal precision setting with the display, or accept the difference knowingly. |
| Placeholder text no longer appears after upgrading to 19 | The float widget dropped its placeholder prop in 19.0. No widget-level fix; use a help tooltip, a default value, or a custom widget if the hint is essential. |
| Typing =5*3 stores the formula literally | The field uses type: "number", whose native input bypasses Odoo's expression parser. Remove the type option to return to the text-based input. |
| Large numbers show as 500G and users want exact figures | human_readable is enabled on the view. Remove the option, or keep it and train users that focusing the field reveals the exact value. |
Float field vs the alternatives
| Widget | Best for | Key difference |
|---|---|---|
float | Plain decimal numbers without a display unit | Locale-aware formatting plus math-expression input, no unit semantics |
| monetary | Amounts tied to a currency | Renders the currency symbol and uses currency decimal rules |
| percentage | Fractions shown as percent | Displays 0.15 as 15% and converts on input |
| float_time | Durations stored as float hours | Formats 1.5 as 01:30 and parses HH:MM input |
| progressbar | Progress toward a max value | Graphical bar rather than an editable number |
Frequently asked questions
How do I control decimals on a float field in Odoo?+
Why does min_display_digits work but minDigits does not?+
Can users type math into Odoo number fields?+
How do I stop Odoo showing trailing zeros like 1.20?+
Does the float widget work on monetary fields?+
Why is there no placeholder on my float field in Odoo 19?+
What is human_readable for?+
Numbers displaying one way and storing another?
Precision mismatches between screens, reports and exports erode trust in an ERP fast. We audit decimal accuracy end to end, from field definitions to view options, and fix the layer that is actually wrong, on Odoo 16 through 19.
Book a free consultation