Returns a preconfigured \NumberFormatter instance.

@return \NumberFormatter
497480
protected function getNumberFormatter()
    {
        $formatter = parent::getNumberFormatter();

        $formatter->setSymbol(\NumberFormatter::GROUPING_SEPARATOR_SYMBOL, $this->thousandsSeparator);
        $formatter->setSymbol(\NumberFormatter::DECIMAL_SEPARATOR_SYMBOL, $this->decimalSeparator);
        $formatter->setPattern(sprintf('#%s##0%s###', $this->thousandsSeparator, $this->decimalSeparator));

        return $formatter;
    }
321584
protected function formatter()
    {
        $key = $this->getLocalesKey(
            $locale = $this->getLocale(),
            $fallbackLocale = $this->getFallbackLocale()
        );

        if (! isset($this->formatters[$key])) {
            $this->formatters[$key] = new CurrencyFormatter(
                new NumberFormatRepository($fallbackLocale),
                $this->data(),
                ['locale' => $locale]
            );
        }

        return $this->formatters[$key];
    }
677403
public function getFormatter()
    {
        $fmt = $this->settings->format;
        $formatter = null;
        if (!is_string($fmt) && is_subclass_of($fmt, 'Luminous\\Formatters\\Formatter')) {
            $formatter = clone $fmt;
        } elseif ($fmt === 'html') {
            $formatter = new HtmlFormatter();
        } elseif ($fmt ===  'html-inline') {
            $formatter = new InlineHtmlFormatter();
        } elseif ($fmt ===  'html-full') {
            $formatter = new FullPageHtmlFormatter();
        } elseif ($fmt === 'latex') {
            $formatter = new LatexFormatter();
        } elseif ($fmt === 'ansi') {
            $formatter = new AnsiFormatter();
        } elseif ($fmt ===  null || $fmt === 'none') {
            $formatter = new IdentityFormatter();
        }

        if ($formatter === null) {
            throw new Exception('Unknown formatter: ' . $this->settings->format);
            return null;
        }
        $this->setFormatterOptions($formatter);
        return $formatter;
    }
377296
public static String formatNumber(Number count) {
		Format numberFormatter = getNumberFormatter(DEFAULT_NUMBER_FORMAT);
		return numberFormatter.format(count);
	}
1022128
protected function gerarNossoNumero()
    {
        $convenio = $this->getConvenio();
        $numero_boleto = $this->getNumero();
        switch (strlen($convenio)) {
        case 4:
            $numero = Util::numberFormatGeral($convenio, 4) . Util::numberFormatGeral($numero_boleto, 7);
            break;
        case 6:
            if (in_array($this->getCarteira(), ['16', '18']) && $this->getVariacaoCarteira() == 17) {
                $numero = Util::numberFormatGeral($numero_boleto, 17);
            } else {
                $numero = Util::numberFormatGeral($convenio, 6) . Util::numberFormatGeral($numero_boleto, 5);
            }
            break;
        case 7:
            $numero = Util::numberFormatGeral($convenio, 7) . Util::numberFormatGeral($numero_boleto, 10);
            break;
        default:
            throw new \Exception('O código do convênio precisa ter 4, 6 ou 7 dígitos!');
        }
        return $numero;
    }
1105668
protected function generate()
    {
        if (! is_null($this->fakerString)) {
            return $this->fakerString;
        }

        if ($this->array) {
            return $this->generateArray();
        }

        return $this->numeric
            ? $this->generateNumeric()
            : $this->generateAlpha();
    }
545431
public static Formatter getFormatter()
    {
        Formatter formatter = out.get();
        if (formatter == null)
        {
            formatter = new Formatter(new StringBuilder());
            out.set(formatter);
        }
        else
        {
            StringBuilder sb = (StringBuilder) formatter.out();
            sb.setLength(0);
        }
        return formatter;
    }
304041
public function getFormatter(Column $column)
    {
        $decimalDigits = $column->getDecimalDigits();

        return function (Model $model, $value) use ($decimalDigits) {
            return number_format($value, $decimalDigits);
        };
    }
102636
public function getDateFormat()
    {
        $formatter = new IntlDateFormatter(
            $this->getLocale(),
            IntlDateFormatter::MEDIUM,
            IntlDateFormatter::NONE
        );
        $format = $formatter->getPattern();

        $this->extend('updateDateFormat', $format);

        return $format;
    }
396400
private function initFormatters()
    {
        $formatter = $this->getFormatter();

        $formatter->setStyle('warning', new OutputFormatterStyle('black', 'yellow'));
        $formatter->setStyle('error',   new OutputFormatterStyle('black', 'red', ['bold']));
        $formatter->setStyle('aside',   new OutputFormatterStyle('blue'));
        $formatter->setStyle('strong',  new OutputFormatterStyle(null, null, ['bold']));
        $formatter->setStyle('return',  new OutputFormatterStyle('cyan'));
        $formatter->setStyle('urgent',  new OutputFormatterStyle('red'));
        $formatter->setStyle('hidden',  new OutputFormatterStyle('black'));

        // Visibility
        $formatter->setStyle('public',    new OutputFormatterStyle(null, null, ['bold']));
        $formatter->setStyle('protected', new OutputFormatterStyle('yellow'));
        $formatter->setStyle('private',   new OutputFormatterStyle('red'));
        $formatter->setStyle('global',    new OutputFormatterStyle('cyan', null, ['bold']));
        $formatter->setStyle('const',     new OutputFormatterStyle('cyan'));
        $formatter->setStyle('class',     new OutputFormatterStyle('blue', null, ['underscore']));
        $formatter->setStyle('function',  new OutputFormatterStyle(null));
        $formatter->setStyle('default',   new OutputFormatterStyle(null));

        // Types
        $formatter->setStyle('number',   new OutputFormatterStyle('magenta'));
        $formatter->setStyle('string',   new OutputFormatterStyle('green'));
        $formatter->setStyle('bool',     new OutputFormatterStyle('cyan'));
        $formatter->setStyle('keyword',  new OutputFormatterStyle('yellow'));
        $formatter->setStyle('comment',  new OutputFormatterStyle('blue'));
        $formatter->setStyle('object',   new OutputFormatterStyle('blue'));
        $formatter->setStyle('resource', new OutputFormatterStyle('yellow'));
    }
681968
public function getFormatter()
    {
        if ($this->formatter !== null) {
            return $this->formatter;
        }

        if (class_exists('PHPUnit_Runner_Version', false)) {
            if ($this->type === "summary") {
                $this->formatter = new SummaryPHPUnitResultFormatter5($this->parent);
            } elseif ($this->type === "clover") {
                $this->formatter = new CloverPHPUnitResultFormatter5($this->parent);
            } elseif ($this->type === "xml") {
                $this->formatter = new XMLPHPUnitResultFormatter5($this->parent);
            } elseif ($this->type === "plain") {
                $this->formatter = new PlainPHPUnitResultFormatter5($this->parent);
            } elseif ($this->type === "crap4j") {
                $this->formatter = new Crap4JPHPUnitResultFormatter5($this->parent);
            } else {
                throw new BuildException("Formatter '" . $this->type . "' not implemented");
            }
        } elseif (\version_compare('6', \PHPUnit\Runner\Version::id(), '>=')
            && \version_compare('7', \PHPUnit\Runner\Version::id(), '<')
        ) {
            if ($this->type === "summary") {
                $this->formatter = new SummaryPHPUnitResultFormatter6($this->parent);
            } elseif ($this->type === "clover") {
                $this->formatter = new CloverPHPUnitResultFormatter6($this->parent);
            } elseif ($this->type === "xml") {
                $this->formatter = new XMLPHPUnitResultFormatter6($this->parent);
            } elseif ($this->type === "plain") {
                $this->formatter = new PlainPHPUnitResultFormatter6($this->parent);
            } elseif ($this->type === "crap4j") {
                $this->formatter = new Crap4JPHPUnitResultFormatter6($this->parent);
            } else {
                throw new BuildException("Formatter '" . $this->type . "' not implemented");
            }
        } else {
            if ($this->type === "summary") {
                $this->formatter = new SummaryPHPUnitResultFormatter7($this->parent);
            } elseif ($this->type === "clover") {
                $this->formatter = new CloverPHPUnitResultFormatter7($this->parent);
            } elseif ($this->type === "xml") {
                $this->formatter = new XMLPHPUnitResultFormatter7($this->parent);
            } elseif ($this->type === "plain") {
                $this->formatter = new PlainPHPUnitResultFormatter7($this->parent);
            } elseif ($this->type === "crap4j") {
                $this->formatter = new Crap4JPHPUnitResultFormatter7($this->parent);
            } else {
                throw new BuildException("Formatter '" . $this->type . "' not implemented");
            }
        }

        return $this->formatter;
    }
1250653
protected function getNumberType()
    {
        $scale = $this->getScale();
        if ($scale === 0) {
            return PHP_INT_SIZE > 4
                ? NumberFormatter::TYPE_INT64
                : NumberFormatter::TYPE_INT32;
        }
        return NumberFormatter::TYPE_DOUBLE;
    }
843468
static public function getDateFormatter()
    {
        if (is_null(self::$service)) {
            $ext = common_ext_ExtensionsManager::singleton()->getExtensionById('tao');
            $service = $ext->getConfig(self::CONFIG_KEY);
            self::$service = $service instanceof DateFormatterInterface
                ? $service
                : new EuropeanFormatter();
        }

        return self::$service;
    }
640817
public function getSizeFormattedAttribute()
    {
        if ($this->size >= (1000 ** 2))
            return number_format($this->size / (1000 ** 2), 2) . ' MB';
        else if ($this->size >= 1000)
            return number_format($this->size / 1000, 2) . ' KB';
        else if ($this->size > 1)
            return number_format($this->size) . ' bytes';
        else
            return number_format($this->size) . ' byte';
    }
1222196
protected function getFormatter()
    {
        // Get formatter
        $format = LineFormatter::SIMPLE_FORMAT;
        if (!Director::is_cli()) {
            $format = "<p>$format</p>";
        }
        return Injector::inst()->createWithArgs(
            LineFormatter::class,
            array($format)
        );
    }
76777
public function number() {
        $this->check_role = 'number';
        $result = is_numeric($this->value);
        $this->checkResult($result);
        return $this;
    }
780455
public function getFormattedTotalNetSum()
    {
        return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($this->oxorder__oxtotalnetsum->value, $this->getOrderCurrency());
    }