Format credit or debit accountside

@param string $value
@return string formatted language string
@throws Exception if sign other than C,D given
5809
public static function formatAccountside($value) {
        if ($value === StaticEb::$accountsideDebitSign) {
            return \Yii::t('common/staticeb', 'Debit');
        } else if ($value === StaticEb::$accountsideCreditSign) {
            return \Yii::t('common/staticeb', 'Credit');
        } else {
            throw new Exception(\Yii::t('common/staticeb', '{value} is not a accounside. Valid values: ' . StaticEb::$accountsideDebitSign . ',' . StaticEb::$accountsideCreditSign, [ 'value' => $value]
            ));
        }
    }
797199
private function addCurrencySymbol(string $value, ?string $currency = null): string
    {
        $currency = $currency ?? $this->defaultCurrency;
        $locale = \Locale::getDefault();

        if (!isset(self::$patterns[$locale])) {
            self::$patterns[$locale] = [];
        }

        if (!isset(self::$patterns[$locale][$currency])) {
            $formatter = new \NumberFormatter($locale, \NumberFormatter::CURRENCY);
            $pattern = $formatter->formatCurrency(123.00, $currency);

            // 1=left-position currency, 2=left-space, 3=right-space, 4=left-position currency.
            // With non latin number scripts.
            preg_match(
                '/^([^\s\xc2\xa0]*)([\s\xc2\xa0]*)\p{N}{3}(?:[,.]\p{N}+)?([\s\xc2\xa0]*)([^\s\xc2\xa0]*)$/iu',
                $pattern,
                $matches
            );

            if (!empty($matches[1])) {
                self::$patterns[$locale][$currency] = ['%1$s'.$matches[2].'%2$s', $matches[1]];
            } elseif (!empty($matches[4])) {
                self::$patterns[$locale][$currency] = ['%2$s'.$matches[3].'%1$s', $matches[4]];
            } else {
                throw new \InvalidArgumentException(
                    sprintf('Locale "%s" with currency "%s" does not provide a currency position.', $locale, $currency)
                );
            }
        }

        return sprintf(self::$patterns[$locale][$currency][0], self::$patterns[$locale][$currency][1], $value);
    }
1012187
public static function convertExponentialToString($value)
    {
        if (!is_float($value)) {
            return $value;
        }

        $result = explode('E', strtoupper($value));

        if (count($result) === 1) {
            return $result[0];
        }

        $dotSplitted = explode('.', $result[0]);

        return '0.' . str_repeat('0', abs($result[1]) - 1) . $dotSplitted[0];
    }
161880
protected function numberToEnglish(string $value): string
    {
        if ('.' !== $this->getDecimalPoint()) {
            return str_replace($this->getDecimalPoint(), '.', $value);
        }
        return $value;
    }
394175
public static function format($value)
    {
        $value = (string) $value;
        $arguments = func_get_args();
        $digit = 64;

        if (isset($arguments[1]) && is_numeric($arguments[1])) {
            $digit = intval($arguments[1]);
        }
        $bn = Utils::toBn($value);
        $bnHex = $bn->toHex(true);
        $padded = mb_substr($bnHex, 0, 1);

        if ($padded !== 'f') {
            $padded = '0';
        }        
        return implode('', array_fill(0, $digit-mb_strlen($bnHex), $padded)) . $bnHex;
    }
266638
protected static function getValueAsINI($value)
    {
        $string = '';

        switch (gettype($value)) {
            case 'integer':
            case 'double':
                $string = $value;
                break;

            case 'boolean':
                $string = $value ? 'true' : 'false';
                break;

            case 'string':
                // Sanitize any CRLF characters..
                $string = '"' . str_replace(["\r\n", "\n"], '\\n', $value) . '"';
                break;
        }

        return $string;
    }
169450
public static function format($value)
    {
        if (isset($value['gas'])) {
            $value['gas'] = QuantityFormatter::format($value['gas']);
        }
        if (isset($value['gasPrice'])) {
            $value['gasPrice'] = QuantityFormatter::format($value['gasPrice']);
        }
        if (isset($value['value'])) {
            $value['value'] = QuantityFormatter::format($value['value']);
        }
        if (isset($value['data'])) {
            $value['data'] = HexFormatter::format($value['data']);
        }
        if (isset($value['nonce'])) {
            $value['nonce'] = QuantityFormatter::format($value['nonce']);
        }
        return $value;
    }
309198
public static function alphanumeric ($value)
    {
        $res = preg_match('/^[0-9a-zA-Z]+$/', $value);
        if (false === $res) {
            throw new Exception("Unable to verify alphanumericy: $value");
        } elseif (0 == $res) {
            return false;
        } else {
            return true;
        }
    }
1188096
public function formatMoneyAsSimpleString(Money $value, $appendCurrency = true)
    {
        $str = $this->formatMoney($value);
        if ($appendCurrency) {
            $str = $str . ' ' . $value->getCurrency();
        }
        else {
            $str = $value . ' ' . $str;
        }

        return $str;
    }
361213
protected function format_value( $value, $raw ) {
		if ( $raw && '' === trim( $value ) ) {
			throw new Exception( 'Raw value for empty string not supported.' );
		}

		return ( $raw ) ? $value : var_export( $value, true );
	}
1169997
protected function format($parameter, $value)
    {
        if ($value) {
            if (is_bool($value)) {
                return strlen($parameter) === 1 ? '-'.$parameter : '--'.$parameter;
            }
            return strlen($parameter) === 1 ? '-'.$parameter.$value : '--'.$parameter.'='.$value;
        }
        return '';
    }
544341
public function format($value): string
    {
        if ($value instanceof Percentage) {
            $value = $value->toPercent();
        }

        return $value->int().'%';
    }
403440
protected function formatValue($format, $value)
    {
        switch ($format) {
            case 'dash':
                return $this->inflector->dasherize($value);
            case 'underscore':
                return $this->inflector->underscore($value);
            case 'studlycaps':
                return $this->inflector->studlify($value);
            case 'camelcase':
                return $this->inflector->camelize($value);
            default:
                throw new RuntimeException('Unable to format value');
        }
    }
403233
protected function formatParameter($value)
    {
        if (\is_bool($value) || \is_array($value) || (null === $value)) {
            $jsonString = json_encode($value);

            if (preg_match('/^(.{60})./us', $jsonString, $matches)) {
                return $matches[1].'...';
            }

            return $jsonString;
        }

        return (string) $value;
    }
1062341
public function escapeSpecialChars($value)
    {
        $payPalEscape = oxNew(\OxidEsales\PayPalModule\Core\Escape::class);

        return $payPalEscape->escapeSpecialChars($value);
    }
744668
public function format($value)
    {
        if ($value instanceOf Percentage) {
            $value = $value->toPercent();
        }

        return $value->int().'%';
    }
1205445
protected function expectKeyword($value)
    {
        if ($this->token->getType() !== Token::NAME_TYPE || $this->token->getValue() !== $value) {
            throw new \Exception(sprintf('Expected %s, found %s', $value, $this->token->getDescription()));
        }

        return $this->advance();
    }