Bug 467852 - Form: Numbers concatenated rather than summed (UK IHT407)
Summary: Form: Numbers concatenated rather than summed (UK IHT407)
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: PDF backend (show other bugs)
Version: 22.12.3
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-27 13:01 UTC by Dave Gilbert
Modified: 2023-04-05 22:08 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Original IHT407 form unfilled (96.95 KB, application/pdf)
2023-03-27 13:01 UTC, Dave Gilbert
Details
IHT407 with dummy values filled as per the bug report (105.92 KB, application/pdf)
2023-03-27 13:02 UTC, Dave Gilbert
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Gilbert 2023-03-27 13:01:55 UTC
Created attachment 157630 [details]
Original IHT407 form unfilled

SUMMARY
In the attached (government issued) form, the summation of fields is working as concatenation rather than summing the values.
The original form is available: https://www.gov.uk/government/publications/inheritance-tax-household-and-personal-goods-iht407
I've attached:
  a) An original version
  b) A version with a value in the first entry in page 2 of £300, top row, and you can see the total field at the bottom has a load of 0's that correspond to each row adding an extra '0' to the result; this carries into the total on the next page

STEPS TO REPRODUCE
1.  Load the empty form
2.  Enter a numeric value, e.g. 300, into the top right field on page 2 (Open market value, top row)
3. Enter another numeric value, e.g. 55 into the page 4 field 4, 'Total value of other'

OBSERVED RESULT
The total on page 2 is 3000000000000000000
The total on page 5 is something like 300000000000000000055

EXPECTED RESULT
£300 and £355

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Fedora 37
(available in About System)
KDE Plasma Version: 5.27.3 - but running under xfce
KDE Frameworks Version: 5.104.0
Qt Version: 5.15.8

ADDITIONAL INFORMATION
I've seen a non-reproducible crash on that form and other oddities, try tabbing around on page 2
Comment 1 Dave Gilbert 2023-03-27 13:02:41 UTC
Created attachment 157631 [details]
IHT407 with dummy values filled as per the bug report
Comment 2 Bug Janitor Service 2023-03-28 17:25:21 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/okular/-/merge_requests/710
Comment 3 Albert Astals Cid 2023-04-05 21:39:38 UTC
Git commit 09038f4fb52b97a9b82cc8dc14ea0d962ad6b0f1 by Albert Astals Cid.
Committed on 05/04/2023 at 21:19.
Pushed by aacid into branch 'master'.

JS: Make field.value return a number if possible

Quoting the Adobe documentation
 'for a field with a value of “020”, value returns the integer 20'

M  +8    -1    core/script/kjs_field.cpp

https://invent.kde.org/graphics/okular/commit/09038f4fb52b97a9b82cc8dc14ea0d962ad6b0f1
Comment 4 Albert Astals Cid 2023-04-05 22:08:25 UTC
Git commit 3cd7a780949e716fbf248b3b08049cf443389c28 by Albert Astals Cid.
Committed on 05/04/2023 at 22:07.
Pushed by aacid into branch 'release/23.04'.

JS: Make field.value return a number if possible

Quoting the Adobe documentation
 'for a field with a value of “020”, value returns the integer 20'
(cherry picked from commit 09038f4fb52b97a9b82cc8dc14ea0d962ad6b0f1)

M  +8    -1    core/script/kjs_field.cpp

https://invent.kde.org/graphics/okular/commit/3cd7a780949e716fbf248b3b08049cf443389c28