Integer in words
@param int $amount Amount of objects (0 <= amount <= PHP_INT_MAX)
@param int $gender (MALE, FEMALE or NEUTER)
@return string In-words representation of numeral
189725
public function getInWordsInt($amount, $gender = RUtils::MALE)
    {
        $amount = round($amount);
        return $this->sumString($amount, $gender);
    }
38972
public function formatAmount($amount, $currency = null)
    {
        return str_replace('.00', '', $this->moneyHelper->formatAmount($amount, $currency));
    }
1092435
public static function br(int $amount = 1) : string
    {
        $output = "";
        for ($i = 0; $i < $amount; $i++) {
            $output .= self::tag("br");
        }
        return $output;
    }
1291666
public static function getWord($number)
    {
        $hyphen      = '-';
        $conjunction = ' and ';
        $separator   = ', ';
        $negative    = 'negative ';
        $decimal     = ' point ';
        $dictionary  = array(
            0                   => 'zero',
            1                   => 'one',
            2                   => 'two',
            3                   => 'three',
            4                   => 'four',
            5                   => 'five',
            6                   => 'six',
            7                   => 'seven',
            8                   => 'eight',
            9                   => 'nine',
            10                  => 'ten',
            11                  => 'eleven',
            12                  => 'twelve',
            13                  => 'thirteen',
            14                  => 'fourteen',
            15                  => 'fifteen',
            16                  => 'sixteen',
            17                  => 'seventeen',
            18                  => 'eighteen',
            19                  => 'nineteen',
            20                  => 'twenty',
            30                  => 'thirty',
            40                  => 'fourty',
            50                  => 'fifty',
            60                  => 'sixty',
            70                  => 'seventy',
            80                  => 'eighty',
            90                  => 'ninety',
            100                 => 'hundred',
            1000                => 'thousand',
            1000000             => 'million',
            1000000000          => 'billion',
            1000000000000       => 'trillion',
            1000000000000000    => 'quadrillion',
            1000000000000000000 => 'quintillion'
        );

        if (!is_numeric($number)) {
            return false;
        }

        if (($number >= 0 && (int) $number < 0) || (int) $number < 0 - PHP_INT_MAX) {
            // overflow
            trigger_error(
                'convert_number_to_words only accepts numbers between -' . PHP_INT_MAX . ' and ' . PHP_INT_MAX,
                E_USER_WARNING
            );
            return false;
        }

        if ($number < 0) {
            return $negative . convert_number_to_words(abs($number));
        }

        $string = $fraction = null;

        if (strpos($number, '.') !== false) {
            list($number, $fraction) = explode('.', $number);
        }

        switch (true) {
            case $number < 21:
                $string = $dictionary[$number];
                break;
            case $number < 100:
                $tens     = ((int) ($number / 10)) * 10;
                $units    = $number % 10;
                $string = $dictionary[$tens];
                if ($units) {
                    $string .= $hyphen . $dictionary[$units];
                }
                break;
            case $number < 1000:
                $hundreds    = $number / 100;
                $remainder = $number % 100;
                $string = $dictionary[$hundreds] . ' ' . $dictionary[100];
                if ($remainder) {
                    $string .= $conjunction . convert_number_to_words($remainder);
                }
                break;
            default:
                $baseUnit = pow(1000, floor(log($number, 1000)));
                $numBaseUnits = (int) ($number / $baseUnit);
                $remainder = $number % $baseUnit;
                $string = convert_number_to_words($numBaseUnits) . ' ' . $dictionary[$baseUnit];
                if ($remainder) {
                    $string .= $remainder < 100 ? $conjunction : $separator;
                    $string .= convert_number_to_words($remainder);
                }
                break;
        }

        if (null !== $fraction && is_numeric($fraction)) {
            $string .= $decimal;
            $words = array();
            foreach (str_split((string) $fraction) as $number) {
                $words[] = $dictionary[$number];
            }
            $string .= implode(' ', $words);
        }

        return $string;
    }
830149
public function getCustomerGender()
    {
        $genderId = $this->model->getGender();
        if (is_numeric($genderId)) {
            $gender = $this->model->getAttribute('gender')
                ->getSource()->getOptionText($genderId);

            return $gender;
        }

        return '';
    }
1273987
private static function discardDecimalDigitsZero($amount, $minimumDecimalDigits = 0)
    {
        if (false !== strpos($amount, '.')) {
            while ('0' == substr($amount, -1)) {
                $amount = substr($amount, 0, -1);
            }

            if ('.' == substr($amount, -1)) {
                $amount = substr($amount, 0, -1);
            }
        }

        if ($minimumDecimalDigits > 0) {
            if (false === strpos($amount, '.')) {
                $amount .= '.';
            }

            $currentDecimalDigits = strlen(substr($amount, strpos($amount, '.') + 1));
            $minimumDecimalDigits -= $currentDecimalDigits;

            while ($minimumDecimalDigits > 0) {
                $amount .= '0';
                $minimumDecimalDigits--;
            }
        }

        return $amount;
    }
330886
public function getBodyWeight(GenderCode $genderCode, Tables $tables): int
    {
        $weightInKg = $this->getWeightInKg($genderCode, $tables);

        return (new Weight($weightInKg, Weight::KG, $tables->getWeightTable()))->getBonus()->getValue();
    }
729154
public function genderIcon($value) {
		$value = (int)$value;
		if ($value == static::GENDER_FEMALE) {
			$icon = $this->icon('female');
		} elseif ($value == static::GENDER_MALE) {
			$icon = $this->icon('male');
		} else {
			$icon = $this->icon('genderless', [], ['title' => __d('tools', 'Unknown')]);
		}
		return $icon;
	}
1267934
private function getAmount($amount, $currency)
    {
        $list = self::getCurrencyList();

        if (!isset($list[$currency])) {
            throw new \RuntimeException('Invalid currency provided');
        }

        return (int) (100 * bcmul('1', (string) $amount, $list[$currency]['fraction']));
    }
24545
public function inflectNounByNumber($number, $singular, $plural, $genitivePlural)
    {
        $units = $number % 10;
        $tens = ((int) ($number / 10)) % 10;

        if ($number === 1) {
            return $singular;
        }

        if ($tens === 1 && $units > 1) {
            return $genitivePlural;
        }

        if ($units >= 2 && $units <= 4) {
            return $plural;
        }

        return $genitivePlural;
    }
98600
public function setGender($gender)
    {
        if (!in_array($gender, [static::GENDER_MALE, static::GENDER_FEMALE])) {
            throw new Exception\InvalidArgumentException(
                sprintf(
                    '%s expects parameter 1 to be one of %s or %s, %s provided instead',
                    __METHOD__,
                    static::GENDER_MALE,
                    static::GENDER_FEMALE,
                    $gender
                )
            );
        }

        $this->gender = (int) $gender;
    }
1238773
public function formatAmount($amount, $currency)
    {
        switch ($currency) {
            case "JPY":
            case "IDR":
            case "KRW":
            case "BYR":
            case "VND":
            case "CVE":
            case "DJF":
            case "GNF":
            case "PYG":
            case "RWF":
            case "UGX":
            case "VUV":
            case "XAF":
            case "XOF":
            case "XPF":
            case "GHC":
            case "KMF":
                $format = 0;
                break;
            case "MRO":
                $format = 1;
                break;
            case "BHD":
            case "JOD":
            case "KWD":
            case "OMR":
            case "LYD":
            case "TND":
                $format = 3;
                break;
            default:
                $format = 2;
                break;
        }

        return (int)number_format($amount, $format, '', '');
    }
1021993
static public function getGenderValue($value=null)
    {
        return $value ? ($value == 1 || $value == '男' ? 1 : ($value == 2 || $value == '女' ? 2 : 0)) : 0;
    }
855543
public function amount($money)
    {
        if (null === $money) {
            return null;
        }

        $cents = $money * 100;
        if (!is_numeric($money) || $money < 0) {
            throw new \InvalidArgumentException('money amount must be a positive number.');
        }

        return ($this->money_format() == 'cents')
            ? number_format($cents, 0, '', '')
            : number_format($money, 2);
    }
495682
public function amount($money)
    {
        if (null === $money) {
            return;
        }

        if (is_string($money) || $money < 0) {
            throw new InvalidArgumentException('Money amount must be a positive number.');
        }

        if ($this->getMoneyFormat() === 'cents') {
            return number_format($money, 0, '', '');
        }

        return sprintf('%.2f', number_format($money, 2, '.', '') / 100);
    }
578817
public function validateBasketAmount($amount)
    {
        $amount = str_replace(',', '.', $amount);

        if (!is_numeric($amount) || $amount < 0) {
            /**
             * @var \OxidEsales\Eshop\Core\Exception\ArticleInputException $exception
             */
            $exception = oxNew(\OxidEsales\Eshop\Core\Exception\ArticleInputException::class);
            $exception->setMessage(\OxidEsales\Eshop\Core\Registry::getLang()->translateString('ERROR_MESSAGE_INPUT_INVALIDAMOUNT'));
            throw $exception;
        }

        if (!\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blAllowUnevenAmounts')) {
            $amount = round(( string ) $amount);
        }

        //negative amounts are not allowed
        //$dAmount = abs($dAmount);

        return $amount;
    }
165169
private function showDigitsGroup($number, $last = false)
    {
        $ret = '';

        $units = $number % 10;
        $tens = (int) ($number / 10) % 10;
        $hundreds = (int) ($number / 100) % 10;

        if ($hundreds) {
            if ($hundreds > 1) {
                $ret .= BelgianDictionary::$digits[$hundreds] . BelgianDictionary::$wordSeparator . BelgianDictionary::$miscNumbers[100];
                if ($last && !$units && !$tens) {
                    $ret .= BelgianDictionary::$pluralSuffix;
                }
            } else {
                $ret .= BelgianDictionary::$miscNumbers[100];
            }
            $ret .= BelgianDictionary::$wordSeparator;
        }

        if ($tens) {
            if ($tens === 1) {
                if ($units <= 6) {
                    $ret .= BelgianDictionary::$miscNumbers[10 + $units];
                } else {
                    $ret .= BelgianDictionary::$miscNumbers[10] . '-' . BelgianDictionary::$digits[$units];
                }
                $units = 0;
            } elseif ($tens === 8) {
                $ret .= BelgianDictionary::$digits[4] . BelgianDictionary::$dash . BelgianDictionary::$miscNumbers[20];
                $resto = $tens * 10 + $units - 80;
                if ($resto) {
                    $ret .= BelgianDictionary::$dash;
                    $ret .= $this->showDigitsGroup($resto);
                    $units = 0;
                } else {
                    $ret .= BelgianDictionary::$pluralSuffix;
                }
            } else {
                $ret .= BelgianDictionary::$miscNumbers[$tens * 10];
            }
        }

        if ($units) {
            if ($tens) {
                if ($units === 1) {
                    $ret .= BelgianDictionary::$wordSeparator . BelgianDictionary::$and . BelgianDictionary::$wordSeparator;
                } else {
                    $ret .= BelgianDictionary::$dash;
                }
            }
            $ret .= BelgianDictionary::$digits[$units];
        }

        return rtrim($ret, BelgianDictionary::$wordSeparator);
    }