Last modified: 2005-09-12 20:38:26 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().
Created attachment 866 [details] New implementation of LanguageBg::formatNum()
(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   (see bug 2749) and second why don't you just call commafy() instead of duplicating the code to add something every three digits?
(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   (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?
(Please add wikibugs-l@wikipedia.org to the CC list when assigning bugs.)
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).
Looks ok, committed to HEAD.