private function findPreferredLanguageFrom(&$formatstring) { // Localized preferred user language if (strpos($formatstring, 'LOCL') !== false && ($languageCode = Localizer::getLanguageCodeFrom($formatstring)) !== false) { $this->intlNumberFormatter->setOption('preferred.language', $languageCode); } // Remove any remaining $formatstring = str_replace(array('#LOCL', 'LOCL'), '', $formatstring); }
/** * @deprecated since 2.1, use NumberFormatter instead */ function smwfNumberFormat($value, $decplaces = 3) { return IntlNumberFormatter::getInstance()->getLocalizedFormattedNumber($value, $decplaces); }
public function testTryTogetSeparatorByLanguageOnInvalidTypeThrowsException() { $instance = new IntlNumberFormatter(10000000); $this->setExpectedException('InvalidArgumentException'); $instance->getSeparatorByLanguage('Foo'); }