[MGNLUI-4066] TextFieldDefinition with "Double" or "Decimal" type should not round input values Created: 03/Nov/16 Updated: 05/Oct/21 Resolved: 02/Dec/16 |
|
| Status: | Closed |
| Project: | Magnolia UI |
| Component/s: | forms |
| Affects Version/s: | 5.4.7 |
| Fix Version/s: | 5.5.1 |
| Type: | Bug | Priority: | Major |
| Reporter: | Mikaël Geljić | Assignee: | Oanh Thai Hoang |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | converter, double | ||
| Remaining Estimate: | 0d | ||
| Time Spent: | 3d | ||
| Original Estimate: | 3d | ||
| Issue Links: |
|
||||||||
| Template: |
|
||||||||
| Acceptance criteria: |
Empty
|
||||||||
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||||||
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
||||||||
| Date of First Response: | |||||||||
| Sprint: | Saigon 73 | ||||||||
| Story Points: | 5 | ||||||||
| Description |
|
Vaadin applies StringToDoubleConverter by default for Double properties. When applying the new value back on the server-side, Vaadin's AbstractTextField does this thing of beauty:
This immediately updates the presentation to however this value would be rendered at a later point. I haven't dug yet why the approximated presentation value bubbles back to the model though. ProposalI suggest we bridge the gap and override StringToDoubleConverter#getFormat() and #setMaximumFractionDigits() to whatever more meaningful, then assign it automatically from the TextFieldFactory when property type is Double.
Original report
via Magnolia forums: TextFieldDefinition with type "Double" or "Decimal" only can keep 3 digitals after point |
| Comments |
| Comment by Khoa Nguyen [ 05/Oct/21 ] |
|
Hello. I have the same thing happening in Magnolia 6.2.11 |