Last modified: 2010-03-02 14:19:16 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T22285, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 20285 - floating point numbers
floating point numbers
Status: RESOLVED INVALID
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Markus Krötzsch
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-08-17 10:27 UTC by lmout1982
Modified: 2010-03-02 14:19 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description lmout1982 2009-08-17 10:27:06 UTC
The decimal separator have an additional space like this: “5 .48652” (5 .48652 in the page source code). The plain format has no effect.

The problem can be viewed online at: http://wiki.culture-langues-lorraine.org/Test

Version of SMW used: 1.4.2
Version of MW used: 1.15.1
Server setup used: PHP 5.2.6 (cgi), MySQL 4.0.27
The problem is not reproducible on a test page on the sandbox site.
Comment 1 Markus Krötzsch 2009-09-09 09:32:30 UTC
Refreshing the page ("purger" tab) fixed the problem for me (not being logged in). I am not sure what could have cause the bug in the first place. Please let us know if it should reappear. The plain format was not available in SMW 1.4.2 yet, so its not surprising that it has no effect.
Comment 2 jdelic 2010-01-21 22:02:28 UTC
I'll dare to reopen this bug, as I can confirm it. 

A property with [[Has type::Number]] will render a floating point value like this "4 .321", because ".321" will be interpreted as the value's unit. I encountered this while working with Ontoprise's triple store where these values will be returned as "http://www.w3.org/2001/XMLSchema#unit" instead of the correct "http://www.w3.org/2001/XMLSchema#double".

Appending a zero "4.3210" will sometimes fix the issue.
Comment 3 jdelic 2010-01-21 22:07:22 UTC
I confirmed this on SMW 1.4.3 / MW 1.15.1 btw.
Comment 4 Markus Krötzsch 2010-03-02 14:19:16 UTC
I understand the problem now. Some languages use "." as a decimal separator while others use ",". In some languages, one of "." and "," is furthermore accepted as a(n optional) separator for thousands. In other languages, the separator for thousands is only space, and no other symbols is allowed. Therefore, it is important to use the right input syntax for the language setting. Unfortunately, it is not possible to support all syntactic forms that are used internationally for numbers at once since there are cases where the value is ambiguous across languages. Here are some examples:

* 4,123 in English is a number above four thousand
* 4.123 in English is the number four with a fraction
* 4,123 in German is the number four with a fraction
* 4.123 in German is a number above four thousand
* 4,123 in French is the number four with a fraction
* 4.123 in French is not a number, since "." is not understood in French numbers. Hence SMW falls back to considering the unclear part of the input as a unit, so the value becomes the number four in the unit ".123".

You can see the values of "MediaWiki:smw_decseparator" and "MediaWiki:smw_kiloseparator" for finding out what the respective syntactic conventions are for your language. You can also change the values locally if you find that, for some reason, the users of your French or German wiki write numbers in English.

This explains the unwanted display. Adjust your writing to your language, or vice versa to fix the problem. If you think that the localisation of number parsing to some language is wrong, then this would be a bug in the SMW translation that can be fixed on translatewiki.net.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links