Issue 102499 - Cell formatted as percent: inconsistent input handling
Summary: Cell formatted as percent: inconsistent input handling
Status: CONFIRMED
Alias: None
Product: Calc
Classification: Application
Component: editing (show other issues)
Version: OOo 3.1
Hardware: PC All
: P4 Trivial (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords: oooqa
: 119139 (view as issue list)
Depends on:
Blocks:
 
Reported: 2009-06-04 12:49 UTC by mreiter
Modified: 2013-07-10 21:58 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description mreiter 2009-06-04 12:49:29 UTC
Format a cell as per cent, then insert
2     ->   2,00%    o.k.
1,2   ->   1,20%    o.k. 
0,2   ->   0,20%    o.k.
,2    ->   20,00%   ????

When a cell is formatted as currency or standard, ",2" is recognized correctly
(as "0,20 €" or "0,20"), the problem only exists when the format is per cent and
you do not insert a leading zero.
Problem appears with OOo 3.1 on Vista + SP1 and XP+SP3.
Comment 1 jbf.faure 2009-06-06 21:16:33 UTC
Interesting !
The behavior is different if you the number after having double-clicked in the
cell or not.
1/ format several cells as percent
2/ select a cell and type 2,1 => the content becomes 2,10% after you have
pressed Enter key.
3/ double-click in another cell, the cursor blinks in the cell, type 2,1 => the
content becomes 210,00% after you have pressed Enter key.

In the first case the % sign appears immediately after you type the first
character, then you enter in edit mode in the cell and you continue to type.
In the second case, the % sign appears only after you have pressed the Enter key
to validate your input.

I think it is not what the end user expects.
Tested on OOo 3.1.0 FR/US on Ubuntu 8.04.
Comment 2 mreiter 2009-06-06 22:45:48 UTC
I can confirm the behavior jbfaure describes for OOo 3.1 on XP+SP3 and Vista+SP1.
Comment 3 Rainer Bielefeld 2009-06-27 07:06:22 UTC
I can confirm the behaviour, and I think that there are some inconsistence.

1.For all Numbers inserted as correct numbers %-formatting will only add the "%"
as expected.

2. Several Numbers that need further calculation (like ",2", "=2", "+2") will be
handled as if you change formatting afterwards. That isn't without any logic, I
can live with it.

3. But "-1" (similar to those from second group) is handled as under "1.", the
result will be "-1%"

So the remaining inconsistence is:

Input "+1"  ->  100%
Input "-1"  ->   -1%
Comment 4 AH 2012-03-29 02:07:14 UTC
*** Issue 119139 has been marked as a duplicate of this issue. ***
Comment 5 AH 2012-03-29 02:17:17 UTC
Tested on Windows 7, XP and 3.2.1, 3.3.0

Steps to reproduce:
1     Start new Calc file
2     Go to Format -> Cell -> Numbers tab -> Select "-13%" for this time
      ("0%" for the formatting code)

3'    Place cursor on the cell and enter "1" -> Cell returns "1%"
3''   Place cursor on the cell and double click, or press F2 key to
      go Edit Mode, then enter "1" -> Cell returns "100%"
3'''  Place cursor on the cell and enter "1" into Formula Bar
      ->  Cell returns "100%"
3'''' Place cursor on the cell and enter "1" just like 3' but this
      time, by Double Bite letters using IME(Japanese for my case)
      -> Cell returns "100%"

Expected:
Cell should return "1%" in all the above cases.
Comment 6 Terry 2012-03-29 04:09:10 UTC
I confirm the 1st, 2nd and 3rd cases mentioned by Sushi.  I do not understand the 4th case and probably could not replicate it.

My expected results are the same as Sushi's.

If I enter the number 1 before formatting the cell as percent, formatting renders the entry as 100%.
Comment 7 Terry 2012-03-29 04:10:15 UTC
I confirm the 1st, 2nd and 3rd cases mentioned by Sushi.  I do not understand the 4th case and probably could not replicate it.

My expected results are the same as Sushi's.

If I enter the number 1 before formatting the cell as percent, formatting renders the entry as 100%.

I have 3.3 (Linux, rpm) version.
Comment 8 AH 2012-03-29 04:57:28 UTC
>Terry
Thank you for testing.

As for the 4th case, I'm not too familiar with Linux but I could still
reproduce the same behavior with LibreOffice 3.5.0 on Ubuntu 11.10 using
iBus IME. So I suppose it should be reproducible with OOo 3.3.0 running
on Linux as well.

What IME have you used?

>If I enter the number 1 before formatting the cell as percent,
 formatting renders the entry as 100%
As for this case, I think it is working as designed since the value "1"
entered before specifying a format is considered a serial value. You
would notice if you enter "0.01" into a cell before specifying a format
and then set "%" format to that cell, the cell returns "1%"

On the other hand, if you set "%" formatting to a cell and enter "1" 
to get a value "1%" showing in that cell, then change the format back
to "Standard", the cell should return "0.01"

If you still want that "1" which you entered before specifying a format
to be "1%" when its formatting is changed, then perhaps defining your
own formatting code would do?

Just type in    #"%"   (be sure to include the " when entering) into
Formatting Code input box in the Cell Formatting Dialog Box.

Sorry if you are already aware of it.
Comment 9 Terry 2012-03-29 11:16:11 UTC
@Sushi.  I don't even know what ime is.  I'm sure your result is correct.
Comment 10 AH 2012-03-30 08:41:29 UTC
> Terry
Ah, I see what you mean now.

IME stands for Input Method Editor on Windows OS's or just IM on Linux.

IME is needed to input Japanese characters(or other Asian characters)
and it allows you to toggle between Direct Input Mode/Convert Mode.

Direct Input Mode works the same as regular inputting method on English
keyboards. It enters texts and numbers with single byte characters and
confirms every input on every key stroke.

Where as in Convert Mode, texts are entered with double byte characters,
and a dotted line appears underneath those texts to indicate that the
Convert Mode is active. Press Space key to convert texts into something
else. Press Enter to confirm the input.

It also applies to numbers as well when Convert Mode is active. Numbers
are in double byte, and a dotted line appears underneath. Press Enter to
confirm the input.

I think it is handled in a similar manner to the case on Comment 3 of
this Bug which is "Several Numbers that need further calculation will
be handled as if you change formatting afterwards." since one Enter
is needed to end the conversion process, and another Enter to confirm
the input to that cell. (Or I may be wrong)

If you don't mind, could you check to see if you have IM installed on
your system via "System Settings" -> "Language Support" -> "Install/
Remove Languages" and if there is anything else other than English,
then you should be able to choose what IM to use at "Keyboard input
method system"

Alt+Shift to turn IME on, and Shift+CapsLock to toggle Convert Mode.
However, this is for Windows using English keyboard(Japanese keyboard
has specific key for this) so you might have to specify what key to
use on Linux.

If you have no IME installed, then I can only hope someone with IME
would confirm my case... Either way, thank you for taking your time
for this. Much appreciated.

Regards,