summaryrefslogtreecommitdiff
path: root/languages/classes/LanguageBg.php
blob: bb10675a96e423e9a9cc1b42d9934c465a6747f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php

/** Bulgarian (Български)
 *
 * @ingroup 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 $_;
		}
	}
}