You are here

public function DatexObject::decor in Datex 7.2

Transliterate English numbers to localized numbers and vice versa.

1 call to DatexObject::decor()
DatexObject::formatINTL in datex_api/datex_api.class.inc
Format datetime using PHP-Intl.

File

datex_api/datex_api.class.inc, line 786
Provides an API to work with dates.

Class

DatexObject
Base class for localized DateTime.

Code

public function decor($str, $decorate = FALSE) {
  static $en = array(
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
  );
  $localized = $this
    ->getInfo('numbers');
  return $decorate ? str_replace($en, $localized, $str) : str_replace($localized, $en, $str);
}