Bug 133485 - Append % percent sign also while entering a leading decimal separator in a percent formatted cell
Summary: Append % percent sign also while entering a leading decimal separator in a pe...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Eike Rathke
URL:
Whiteboard: target:7.1.0 target:7.0.0.1
Keywords:
: 150843 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-05-28 20:06 UTC by dheif
Modified: 2022-09-22 09:05 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dheif 2020-05-28 20:06:49 UTC
Description:
using LibreOffice Version: 6.4.4.2 (x64) Build ID: 3d775be2011f3886db32dfd395a6a6d1ca2630ff 
in which a cell formated as "percent" (-12.95%) returns wrong number. 
Entering a '2' results in showing 2%. 
Entering a '.2' results in showing 20% instead of 0.20% as expected.
If I enter '.002' the result shows 0.20% which appears to be the correct number used in calculating the math.


Steps to Reproduce:
1. format cell "percent" (-12.95%)
2. enter '2' in this cell
3. view = 2%
4. enter '.2' in this cell
5. view = 20%
6. enter .002 in this cell
7. view = 0.20%

Actual Results:
explained above

Expected Results:
I would expect that entering '.2' would result in a view which would indicate two-tenths of a percent, not twenty percent. This has been true for quite some time and I have simply adjusted by entering the raw number indicating the actual mathmatical number I need. Evidently whole numbers are all that are calculated so '.2' would indeed be calculated as 20% even though it was meant to be used as 2/10%.


Reproducible: Always


User Profile Reset: No



Additional Info:
If I enter '=.2/100' in the percent formatted cell I do get the proper view of 0.20%. Live and learn!
Comment 1 Eike Rathke 2020-05-28 21:20:21 UTC
Note that while entering 2 a percent sign is appended so the input is 2%
Also note that while entering .2 no percent sign is appended (because the input does not start with a digit) so the result is correctly 20%, whereas while entering 0.2 a percent sign is appended to form 0.2%
Same for .002 vs 0.002

One could argue that if a leading decimal separator is entered the percent sign should also be appended, to cause less confusion.
Comment 2 Commit Notification 2020-05-29 21:37:41 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/ad46c30506fbb9cdbf51310b48401ec37bdc8b8a

Resolves: tdf#133485 Append % character also for a leading decimal separator

It will be available in 7.1.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 3 Commit Notification 2020-05-30 00:43:23 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-7-0":

https://git.libreoffice.org/core/commit/575e938641c643e58fea8e7bdabfee87daeffedd

Resolves: tdf#133485 Append % character also for a leading decimal separator

It will be available in 7.0.0.1.

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 4 BogdanB 2020-06-10 18:13:41 UTC
It's ok now.
Version: 7.1.0.0.alpha0+
Build ID: cd384e2d31f74223948ea70d8aa3c318d3ceeb50
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2020-06-08_18:31:03
Calc: threaded
Comment 5 Eike Rathke 2022-09-07 12:03:05 UTC
*** Bug 150843 has been marked as a duplicate of this bug. ***