LanguageBg.php 411 B

1234567891011121314151617181920
  1. <?php
  2. /** Bulgarian (Български)
  3. *
  4. * @ingroup Language
  5. */
  6. class LanguageBg extends Language {
  7. /**
  8. * ISO number formatting: 123 456 789,99.
  9. * Avoid tripple grouping by numbers with whole part up to 4 digits.
  10. */
  11. function commafy($_) {
  12. if (!preg_match('/^\d{1,4}$/',$_)) {
  13. return strrev((string)preg_replace('/(\d{3})(?=\d)(?!\d*\.)/','$1,',strrev($_)));
  14. } else {
  15. return $_;
  16. }
  17. }
  18. }