| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Lines of code | 318 |
| Technical Name |
ica_16_digit |
| License | LGPL-3 |
| Versions | 16.0 18.0 |
16 Digit Float Precision
Odoo works well for regular business precision, but high precision float values can become unstable when rounding reaches 15 to 16 decimal places. This module fixes that specific float path while keeping normal Odoo performance and currency behavior unchanged.
- Stabilizes backend rounding for high precision Float fields.
- Keeps normal Monetary currency rounding exactly as Odoo expects.
- Improves ORM round-trip and backend widget formatting for 16-digit business cases.
Default Odoo vs This Module
The difference is not that every field becomes 16-digit precision. The real difference is that this addon protects high precision float operations where default float normalization can expose binary tails. Monetary fields still follow currency decimals and are intentionally left with standard Odoo semantics.
| Field Type | Default Odoo | With 16 Digit Float Precision |
|---|---|---|
Float without digits |
Uses the normal float path and stores values as double precision. Good for common business values and fast calculations. | No behavior change by design. Standard float fields stay on the fast path for compatibility and performance. |
Float with high precision digits=(32, 16) |
Database storage can already be numeric, but Python float rounding and UI formatting may
still show unstable results such as 1.0000000000000002 or
0.30000000000000004.
|
Switches unsafe high precision rounding to a Decimal-based fallback, keeps
float_round, float_compare, and float_repr stable,
and formats backend values consistently up to 16 decimal places.
|
| Monetary field | Uses the currency precision defined in Odoo, usually 2 decimal places, and rounds according to normal monetary rules. |
No monetary rule change. Currency rounding stays the same. Example:
1.2345 still displays and behaves as 1.23 for a 2-decimal
currency.
|
What Problem Does It Solve?
Backend Rounding
Default float normalization can become unsafe when the rounded integer crosses the IEEE-754 safe boundary. That is where precision artifacts start to appear.
ORM Read / Write
High precision float fields may store the right idea in PostgreSQL but still come back through Python float conversion with unstable decimal text.
Backend Display
Standard formatting can reveal binary tails in widgets. This addon also patches the backend formatter so values look consistent to users.
Practical Example
These examples describe the behavior this addon targets. Float precision is improved, while monetary precision remains driven by the selected currency.
Included Improvements
- Patches Odoo float utilities only when high precision fallback is needed.
- Preserves normal low-precision speed for everyday use.
- Keeps
fields.Floatcompatible with existingdigits=(precision, scale). - Leaves currency-based
fields.Monetarybehavior unchanged. - Adds backend formatter overrides for cleaner high precision display.
Please log in to comment on this module