Last modified: 2005-09-12 20:38:26 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 T5408, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 3408 - Incorrect implementation of Bulgarian formatNum()
Incorrect implementation of Bulgarian formatNum()
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Internationalization (Other open bugs)
1.6.x
All All
: Normal normal (vote)
: ---
Assigned To: Borislav Manolov
: patch
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-09-09 17:23 UTC by Borislav Manolov
Modified: 2005-09-12 20:38 UTC (History)
1 user (show)

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


Attachments
New implementation of LanguageBg::formatNum() (785 bytes, patch)
2005-09-09 17:24 UTC, Borislav Manolov
Details
Language::commafy(), w/o "&" (761 bytes, patch)
2005-09-12 09:44 UTC, Borislav Manolov
Details

Description Borislav Manolov 2005-09-09 17:23:24 UTC
formatNum() was incorrect implemented: First all dots were replaced by commas,
and then all commas - by spaces.

The new implementation uses code taken from LanguageEt::commafy().
Comment 1 Borislav Manolov 2005-09-09 17:24:58 UTC
Created attachment 866 [details]
New implementation of LanguageBg::formatNum()
Comment 2 Ævar Arnfjörð Bjarmason 2005-09-09 17:35:24 UTC
(In reply to comment #1)
> Created an attachment (id=866) [edit]
> New implementation of LanguageBg::formatNum()

Am I right that you want to format numbers as 10 000,5 only if they are >=
10000 otherwise format them as 1000,5? First of all you can't use &nbsp (see bug
2749) and second why don't you just call commafy() instead of duplicating the
code to add something every three digits?
Comment 3 Borislav Manolov 2005-09-09 19:22:20 UTC
(In reply to comment #2)
> Am I right that you want to format numbers as 10 000,5 only if they are >=
> 10000 otherwise format them as 1000,5? First of all you can't use &nbsp (see bug
> 2749) and second why don't you just call commafy() instead of duplicating the
> code to add something every three digits?

Yes, you are right about grouping if >= 10000.
And yes, I could call commafy():

	if ( preg_match('/^\d{5}/', $number) ) {
		$number = $this->commafy($number);
	}
	return str_replace(array(',', '.'), array(' ', ','), $number);

Is bug 2749 fixed or no?
Comment 4 Zigger 2005-09-09 23:12:38 UTC
(Please add wikibugs-l@wikipedia.org to the CC list when assigning bugs.)
Comment 5 Borislav Manolov 2005-09-12 09:44:53 UTC
Created attachment 877 [details]
Language::commafy(), w/o "&"

LanguageBg::formatNum() now uses Language::commafy(). The HTML entity " "
is replaced by hex code. I've used some code from LanguageCs class
($digitTransTable array).
Comment 6 Niklas Laxström 2005-09-12 20:38:26 UTC
Looks ok, committed to HEAD.

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


Navigation
Links