Bug 54686 - Numbers with percent signs not detected as numbers in French
Summary: Numbers with percent signs not detected as numbers in French
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Spreadsheet (show other bugs)
Version: 3.5.0 release
Hardware: All All
: medium normal
Assignee: Laurent BP
QA Contact:
URL:
Whiteboard: target:4.2.0 target:4.1.3 target:4.0.6
Keywords: l10n
Depends on:
Blocks:
 
Reported: 2012-09-09 11:10 UTC by Milan Bouchet-Valat
Modified: 2013-09-24 07:58 UTC (History)
5 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Milan Bouchet-Valat 2012-09-09 11:10:44 UTC
Bug 41015 added automatic insertion of a non-break space before percent signs in French, because this is what our typographics rules say. This introduced a small regression in Calc, because now numbers with percent signs are considered as text, not as numbers formatted as percents.

This is related to a problem with the "percents" cell format, which does not include the non-break space between numbers and the % sign. Maybe fixing this would also fix the detection issue.?
Comment 1 Milan Bouchet-Valat 2012-09-09 11:12:11 UTC
First introduced in LO 3.5 in 2011, but confirmed with 3.5.6.2 on Fedora 17.
Comment 2 Andras Timar 2012-09-20 07:33:06 UTC
@Milan: How to reproduce the bug? 

When I enter percentage numbers in Calc (in French), I don't see this. E.g. when I enter "25%", it is not autocorrected, and I get 25% in the cell. When I enter "25 %", it is autocorrected and I see 25% in the cell. When I copy 25<0xA0>% from Writer to a Calc cell, it is treated as text in Calc. 

So, please explain what you did, what you expected and what happened. Thanks!
Comment 3 Milan Bouchet-Valat 2012-09-20 08:01:40 UTC
Really, I did nothing special. This happens with both 3.5.6.2 and 3.6beta1 with a clean config. Just typing "25%" results in "25[nbsp]%", and as you said it's detected as text, not numbers. What version did you test this with? Do you see the same with Writer?

The behavior I'm seeing is expected as it's the correct spacing in French. As I said, this was an improvement introduced by Bug 41015.
Comment 4 Andras Timar 2012-09-20 08:29:29 UTC
I use 3.6.1.2 on Windows. Calc does not autocorrect 25% to 25 % for me. Writer does.
Comment 5 Milan Bouchet-Valat 2012-09-20 15:32:39 UTC
I'm able to reproduce the problem on both Linux and Windows, I just checked with 3.6.1.2. I guess the system's locale is taken into account, and not only LO's options, what's why you don't see this behavior. LC_NUMERIC may be in cause.
Comment 6 Jean-Baptiste Faure 2013-05-30 19:17:24 UTC
Confirmed on LibreOffice 4.0.3 with French language pack under Xubuntu 12.04 x86-64 with French locale.
Steps to reproduce:
1/ in a new spreadsheet type 3% in A1 => you get 3 % left aligned (so detected as text)
2/ menu Tools > AutoCorrect options > Localized options > uncheck "Add non breaking space before specific punctuation marks in french text" => you get 3,00% right aligned (so detected as number).

Best regards. JBF
Comment 7 Chris Wilson 2013-06-12 14:39:37 UTC
*** Bug 62791 has been marked as a duplicate of this bug. ***
Comment 8 Ysabeau 2013-08-28 07:43:36 UTC
Still exists in 4.10.4, Windows (vista).

I think it's better to have to add the space in Writer than an automatic insertion in Calc.
Comment 9 Laurent BP 2013-09-19 19:26:23 UTC
Hi,

Steps to reproduce:
1. Check Tools > AutoCorrect Options > Localized Options > Add non-breaking space...
2. In an empty cell of Calc, change language Format > Cell > Font > Language to French (France)
3. Type "3%" (without quotes) and Enter

Current behavior:
A non-breaking space has been automatically inserted and the value is no more recognized. It is text 3<nbsp>%

Expected behavior:
Value in cell should be 3.00%

If you remove the option, inserting "3 %" (with a regular space) is recognized as a value 3.00%. So the recognition process should also recognized "<value><nbsp>%" as a value.

The same occurs with ":" sign.
- without option, typing "<integer><zero to several spaces>:" is recognized as a value of number of hours
- with option, without space or with several spaces is replaced by "<integer><nbsp>:" and is not recognized as value

Numerous workarounds exist and are listed in the FAQ
https://wiki.documentfoundation.org/FR/FAQ/Calc/137
However, you always realize your mistake too late, and have to retype your value. :(
Comment 10 Commit Notification 2013-09-23 20:40:51 UTC
Laurent Balland-Poirier committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=2f4d7eacabd62db35777682bcca353e142e024bf

fdo#54686 Treat hard blank as soft blank in number



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 11 Commit Notification 2013-09-23 20:57:04 UTC
Laurent Balland-Poirier committed a patch related to this issue.
It has been pushed to "libreoffice-4-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=1ca4b1bae11704a1119a9c680c6ae5b85ea1b31e&h=libreoffice-4-1

fdo#54686 Treat hard blank as soft blank in number


It will be available in LibreOffice 4.1.3.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 12 Commit Notification 2013-09-23 21:08:21 UTC
Laurent Balland-Poirier committed a patch related to this issue.
It has been pushed to "libreoffice-4-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=d6f90b9ec323b1871ff5a23e30bd090b124cf006&h=libreoffice-4-0

fdo#54686 Treat hard blank as soft blank in number


It will be available in LibreOffice 4.0.6.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 13 Milan Bouchet-Valat 2013-09-24 07:58:09 UTC
Great!


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.