public function format($value, string $format = null)
    {
        $formatted = number_format(
            $value,
            $this->decimals,
            $format === 'nomask' ? '' : $this->decimal,
            $format === 'nomask' ? '' : $this->thousand
        );

        switch ($format) {
            case 'name':
                $name = $this->name_plural;
                if (!$name || (float) $value === 1.0) {
                    $name = $this->name;
                }
                return $formatted . ' ' . $name;
                break;

            case 'raw':
            case 'nomask':
                return $formatted;
                break;

            case 'symbol':
            default:
                return $this->symbol . ' ' . $formatted;
                break;
        }
    }