Bug 116451 - XML Form Document: Adding two values of decimal-fields gives wrong decimalseparator
Summary: XML Form Document: Adding two values of decimal-fields gives wrong decimalsep...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Julien Nabet
URL:
Whiteboard: target:7.6.0 target:7.5.4
Keywords:
: 118873 (view as bug list)
Depends on:
Blocks: XML_Form
  Show dependency treegraph
 
Reported: 2018-03-17 15:50 UTC by Robert Großkopf
Modified: 2023-04-27 09:02 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Open the document, input some values to first and second field as described. (9.61 KB, application/vnd.oasis.opendocument.text)
2018-03-17 15:50 UTC, Robert Großkopf
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Großkopf 2018-03-17 15:50:28 UTC
Created attachment 140674 [details]
Open the document, input some values to first and second field as described.

Open the attached document.
All fields of the XML-form are declared as "Decimal". "SumFirstSecond" is defined as the sum of the first and the second field.
Put some new value to "FirstField" or "SecondField" like 6 or 7 or 8 ... Shows the right sum in the field "SumFirstSecond".
Now add some values with decimal-places.
Gives wrong values and declares the sum isn't a decimal-value.

You could get a workaround with declaring the sum as a string and the right sum will be shown - but will be saved with decimal-separator "," instead of "."

I have tried to change the language from German to English but haven't recognized it will make any difference.

You could also see the value when clicking on Instance 1 > instanceData > SumFirstSecond. The wrong decimalseparator could be seen there. If you try to edit the element you could choose "Calculate" as the last condition. If you open the editor for this condition you could see the value is right calculated - with decimal-separator "."
Comment 1 Buovjaga 2018-03-17 16:53:58 UTC
Repro with file.

Arch Linux 64-bit
Version: 6.1.0.0.alpha0+
Build ID: 070dbae6b4dc497d6ae898e60203d25b0e608d73
CPU threads: 8; OS: Linux 4.15; UI render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Built on March 17th 2018

Arch Linux 64-bit
LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4
Comment 2 Robert Großkopf 2018-07-29 13:40:17 UTC
*** Bug 118873 has been marked as a duplicate of this bug. ***
Comment 3 QA Administrators 2019-07-30 03:15:57 UTC Comment hidden (obsolete)
Comment 4 QA Administrators 2021-07-30 06:22:02 UTC Comment hidden (obsolete)
Comment 5 Robert Großkopf 2021-07-31 13:40:17 UTC
Still the same buggy behavior in 
Version: 7.2.0.2 / LibreOffice Community
Build ID: 614be4f5c67816389257027dc5e56c801a547089
CPU threads: 6; OS: Linux 5.3; UI render: default; VCL: kf5 (cairo+xcb)
Locale: de-DE (de_DE.UTF-8); UI: de-DE
Calc: threaded
Comment 6 Robert Großkopf 2023-04-06 09:39:21 UTC
Couldn't be reproduce any more, because calculation doesn't work:
bug 154658
Comment 7 Julien Nabet 2023-04-21 08:18:20 UTC
I gave a try with https://gerrit.libreoffice.org/c/core/+/150750
It works locally but not sure if it's the right way to fix this.

Robert: just for curiosity, did you try to retrieve LO sources and build them?
I don't remember if I already asked you, I just remember you had told in a bugtracker that you'll be retired soon and so you'll have more time.
I mean with the experience you got in QA, you may help a lot by trying some patches locally! (I'm thinking about GET and POST pb for XML form)
Comment 8 Robert Großkopf 2023-04-21 09:36:11 UTC
(In reply to Julien Nabet from comment #7)
> I gave a try with https://gerrit.libreoffice.org/c/core/+/150750
> It works locally but not sure if it's the right way to fix this.
> 
> Robert: just for curiosity, did you try to retrieve LO sources and build
> them?

I didn't update sources since a longer time. Every time I will try it I have to ask my son…
Comment 9 Julien Nabet 2023-04-21 10:15:36 UTC
(In reply to Robert Großkopf from comment #8)
> (In reply to Julien Nabet from comment #7)
> > I gave a try with https://gerrit.libreoffice.org/c/core/+/150750
> > It works locally but not sure if it's the right way to fix this.
> > 
> > Robert: just for curiosity, did you try to retrieve LO sources and build
> > them?
> 
> I didn't update sources since a longer time. Every time I will try it I have
> to ask my son…
To retrieve sources and allow a quick update, the best way is to use "git" to clone the LO repositories.
git clone https://gerrit.libreoffice.org/core libreoffice
it will create a "libreoffice" directory containing all the LO sources.

Then to update your local repository (and avoid to retrieve all the sources again), you can use (in "libreoffice" directory:
git pull -r && git submodule update

If interested (and want to emancipate from your son :-)), you can read https://wiki.documentfoundation.org/Development/BuildingOnLinux.

I'm not a "git" expert but with just some commands, you get the most of it to do what you need.
(if you know "cvs", "git" is a modern "cvs" with more features and without the need to lock the file when you're changing something in it)
Comment 10 Commit Notification 2023-04-21 11:46:47 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/50837fdd60d3d20b5025d94e243b09d92a166fb4

tdf#116451: XML Form: adding 2 values of decimal-fields gives wrong result

It will be available in 7.6.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 11 Julien Nabet 2023-04-21 11:48:46 UTC
Cherry-pick for 7.5 waiting for review here:
https://gerrit.libreoffice.org/c/core/+/150728
Comment 12 Commit Notification 2023-04-22 08:22:47 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/23f54f7089eea0fb500affbed795254cb4ed6a78

tdf#116451: XML Form: adding 2 values of decimal-fields gives wrong result

It will be available in 7.5.4.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 13 Robert Großkopf 2023-04-27 09:02:30 UTC
Tested with 
Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: cb79692883e92de02d87b0662a431f6ff8fba9c8
CPU threads: 6; OS: Linux 5.14; UI render: default; VCL: kf5 (cairo+xcb)
Locale: de-DE (de_DE.UTF-8); UI: de-DE
Calc: threaded

Could confirm it is working now.

Don't know why, but sum will appear here with comma as decimal separator, but is read well in a form control, for example, as currency value. Other fields will appear with point as decimal separator. But: It will work with form controls and this is, what is needed.