Description: - Steps to Reproduce: 1. Open LibreOffice Calc 2. Set format of the A1 as percentage. 3. Click three times to A1 (to switch edit mode) 4. Type 5 5. Press Enter Actual Results: Result is 500% Expected Results: It should be 5% Reproducible: Always User Profile Reset: No Additional Info: -
It works *exactly* the same way in MS Excel. This is likely made intentionally to follow Excel behavior. First, a note. In Calc (and Excel, and other spreadsheet software), a percent format makes the number in the cell mean "part of a whole"; and number 1.0 (one) is considered "a whole", i.e. "100%". Number 0.5 is shown as "50%", and number 0.01 is shown as "1%". This makes normal arithmetic with such cells work as expected: if I need 30% of number 12345, I put 12345 into A1, put 0.3 to B1, and in C1, I use '=A1*B1'. If I format B1 as percent, I get expected display of 30% there. When I *enter* a number with trailing % sign, Calc divides that number by 100 for me: if I enter 15%, Calc writes number 0.15 into the cell (and may also auto-format the cell to use percentage format, so that that "0.15" is displayed as "15%" to me). Now how *Excel* behaves with pre-formatted percentage cells: 1. If you do not enter the edit mode (double-click on the cell) prior to typing, it automatically appends the "%" sign to the entered number, so user sees the added percent immediately; the number is processed then with that percent sign, and correctly divided by 100, so a number "5" that you typed will be shown "5%" when you edit, will be converted to 0.05, and stored in the cell (and shown back as "5%"). 2. If you enter the edit mode before typing into the cell, it does not add anything to your input, allowing you to enter whatever numbers literally, and thus your "5" will become "5" in the cell value, without any change, and will be shown as "500%" back. Calc behaves exactly the same way. Should it be changed?
What number will be in that cells if I change view from percent to number? I'm not sure current behaviour should be changed
Cell values don't change if you change the display format, e.g. display will change from 500% to 5. This is about *entering* values and the difference whether edit view mode was activated before (no % appended to edit string), or input directly i.e. by just typing digits (% appended if numeric). I tend to appending a % character also in the already activated edit view because it would be logical as it would be what the user will see after having closed input without being surprised the display is actually what they entered (5 -> 500%), but that then would differ from Excel; hence the illogical behaviour Calc currently has..
(In reply to Eike Rathke from comment #3) IMO, appending the percent also when the edit mode was pre-activated, would also be logical; only when the edit box was empty or had been cleared. FTR: Google Sheets behave differently in this case: they keep "5", but change cell format from % to generic number. Possibly that could be a license to be "original" (deviate from Excel), and do append the % in the discussed case?
Yes, that's what I meant to express, if it didn't come across.. Empty cell -> F2 -> number character typed (digit or minus sign or decimal sperator) -> append % after cursor.
Thanks to everyone. Mike is right. For a reason(Still hard to understand for me but that is same for all other apps too.) It is normal to turn 5 to 500%. I'm closing that bug report because i described it wrong. Actual bug is related with online side but instead of edit this report I'll create a new report to be more clear.