protected function selfFormat(XType $type, $value, $view, $lang)
    {

        if ($type instanceof BoolType) {
            return $this->formatBool($type, $value, $view, $lang);
        }

        if ($type instanceof UnitType) {
            return $this->formatUnit($type, $value, $view, $lang);
        }

        if ($type instanceof NumberType) {
            return $this->formatNumber($type, $value, $view, $lang);
        }

        if ($type instanceof StringType) {
            return $this->formatString($type, $value, $view, $lang);
        }

        if ($type instanceof TemporalType) {
            return $this->formatTemporal($type, $value, $view, $lang);
        }

        return 'NaN';
    }