summaryrefslogtreecommitdiff
path: root/languages/classes/LanguageBg.php
blob: 4884c2a8d833b39f908493e33417fb9683da8b63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
/** Bulgarian (Български)
 *
 * @package MediaWiki
 * @subpackage Language
 */

/**
 * @package MediaWiki
 * @subpackage Language
 */
class LanguageBg extends Language {
	/**
	 * ISO number formatting: 123 456 789,99.
	 * Avoid tripple grouping by numbers with whole part up to 4 digits.
	 */
	function commafy($_) {
		if (!preg_match('/^\d{1,4}$/',$_)) {
			return strrev((string)preg_replace('/(\d{3})(?=\d)(?!\d*\.)/','$1,',strrev($_)));
		} else {
			return $_;
		}
	}
}
?>