# woocommerce-pos/1.10.3/vendor/brick/math/src/Exception/NumberFormatException.php

WCPOS – Point of Sale (POS) plugin for WooCommerce, version 1.10.3. 36 lines.

- Page: https://pluginprobe.com/plugins/woocommerce-pos/1.10.3/code/vendor/brick/math/src/Exception/NumberFormatException.php
- Raw: https://pluginprobe.com/plugins/woocommerce-pos/1.10.3/raw/vendor/brick/math/src/Exception/NumberFormatException.php
- Modified: 2023-06-12T14:16:10+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/woocommerce-pos/1.10.3/code/vendor/brick/math/src/Exception/NumberFormatException.php#L10-L20`.

```php
<?php

declare(strict_types=1);

namespace Brick\Math\Exception;

/**
 * Exception thrown when attempting to create a number from a string with an invalid format.
 */
class NumberFormatException extends MathException
{
    /**
     * @param string $char The failing character.
     *
     * @return NumberFormatException
     *
     * @psalm-pure
     */
    public static function charNotInAlphabet(string $char) : self
    {
        $ord = \ord($char);

        if ($ord < 32 || $ord > 126) {
            $char = \strtoupper(\dechex($ord));

            if ($ord < 10) {
                $char = '0' . $char;
            }
        } else {
            $char = '"' . $char . '"';
        }

        return new self(sprintf('Char %s is not a valid character in the given alphabet.', $char));
    }
}

```
