Get the basic PHP value of the object type properly
In this case, the type is an int or float

@return int|float
547503
public function getAsNativeType()
    {
        if ($this->isInteger()) {
            return intval($this->value['num']->get());
        }

        return floatval($this->value['num']->get() / $this->value['den']->get());
    }
892869
public function getValue()
	{
		// return $this->_value;

		switch ( $this->_xmlType->TypeCode )
		{
			case XmlTypeCode::String:

				return $this->_value;

			case XmlTypeCode::Double:

				if ( is_infinite( $this->_value ) )
				{
					return $this->_value > 0 ? INF : -INF;
				}

				return $this->_value;

			case XmlTypeCode::Float:

				if ( is_infinite( $this->_value ) )
				{
					return $this->_value > 0 ? INF : -INF;
				}

				return $this->_value;

		}

		return XPath2Convert::ToString( $this->_value );
	}
930575
public static function getTypeFromValue($value)
    {
        switch (gettype($value)) {
            case 'boolean':
                if ($value) {
                    return Type::getTrue();
                }

                return Type::getFalse();

            case 'integer':
                return Type::getInt(false, $value);

            case 'double':
                return Type::getFloat($value);

            case 'string':
                return Type::getString($value);

            case 'array':
                return Type::getArray();

            case 'NULL':
                return Type::getNull();

            default:
                return Type::getMixed();
        }
    }
418741
public function get_value() {
        $this->label = $this->grade->grade_item->itemname;

        $val = $this->grade->finalgrade;
        if ($this->grade->grade_item->scaleid) {
            return $val ? (int)$val : -1;
        } else {
            return $val ? format_float($val, $this->grade->grade_item->get_decimals()) : '';
        }
    }
98636
public function getParsedValue()
    {
        if ($this->parsedValue) {
            return $this->parsedValue;
        }

        $parsedValue = Convert::json2array($this->dataValue());
        return $this->parsedValue = ArrayData::create((array) $parsedValue);
    }
347890
private function getValue($value)
    {
        switch ($this->attributes['type']) {
            case 'int':
            case 'integer':
                return (int) $value;
            case 'real':
            case 'float':
            case 'double':
                return (float) $value;
            case 'bool':
            case 'boolean':
                return (bool) $value;
            case 'collection':
                return new Collection(json_decode($value, true));
            case 'object':
                return json_decode($value);
            case 'array':
                return json_decode($value, true);
            default:
                return $value;
        }
    }
1091619
public function getParsedValue()
    {
        if ($this->parsedValue) {
            return $this->parsedValue;
        }
        $parsedValue = json_decode($this->dataValue(), true);
        return $this->parsedValue = ArrayData::create((array) $parsedValue);
    }
962904
public function getType(): DataType
    {
        if (is_object($this->variable)) {
            $typeName = get_class($this->variable);

            return DataType::make($typeName);
        }

        $typeName = gettype($this->variable);

        return DataType::make($typeName);
    }
210188
public function type(): string
    {
        if (is_string($this->value)) {

            return $this->string($this->value);

        }

        if (is_array($this->value)) {

            return $this->array($this->value);

        }

        if (is_object($this->value)) {

            return $this->object($this->value);

        }

        return gettype($this->value);
    }
47734
public function getPhpDefaultValue()
    {
        if ($this->defaultValue === null) {
            return null;
        }

        if ($this->defaultValue->isExpression()) {
            throw new EngineException("Cannot get PHP version of default value for default value EXPRESSION.");
        }

        if ($this->propelType === PropelTypes::BOOLEAN || $this->propelType === PropelTypes::BOOLEAN_EMU) {
            return $this->booleanValue($this->defaultValue->getValue());
        }

        if (PropelTypes::PHP_ARRAY === $this->propelType) {
            return $this->getDefaultValueForArray($this->defaultValue->getValue());
        }

        return $this->defaultValue->getValue();
    }
1085458
public function toMicro()
    {
        $inner = $this->getAttribute("amount", false); //cast=false
        $decimals = $this->getDivisibility();

        if (is_integer($inner)) {
            $attrib = $inner;
        }
        elseif (is_float($inner)) {
            // we want only integer!
            $attrib = $inner * pow(10, $decimals);
        }
        elseif (is_string($inner)) {
            // parse number string representation. Parsing to float.
            $isFloat = false !== strpos($inner, ".");
            $number = $isFloat ? (float) $inner : (int) $inner;
            $multi  = $isFloat ? pow(10, $decimals) : 1;
            $attrib = $number * $multi;
        }
        elseif (is_array($inner)) {
            // try to read first value of array
            $attrib = array_shift($inner);
        }
        else {
            $attrib = (int) $inner;
        }

        $this->micro = (int) $attrib;
        if ($this->micro < 0)
            // not allowed: 0 in micro XEM is the minimum possible value!
            $this->micro = 0;

        return $this->micro;
    }
840355
public function val() {
		$val = $this->array->val();
		
		if (!is_array($val) && !$val instanceof \Traversable) {
			throw new \Exception("Error while casting value to ArrayValueInterface. The value evaluated is not an array.");
		}
		return $val;
	}
160143
public function getAsActualType($key)
    {
        $type = $this->getType($key);
        $value = null;
        switch ($type) {
            case self::BOOLEAN: {
                $value = $this->getBoolean($key);
                break;
            }
            case self::INT: {
                $value = $this->getInt($key);
                break;
            }
            case self::FLOAT: {
                $value = $this->getFloat($key);
                break;
            }
            case self::STRING: {
                $value = $this->getString($key);
                break;
            }
            case self::DATE: {
                $value = $this->getDate($key);
                break;
            }
            case self::XML: {
                $value = $this->getXML($key);
                break;
            }
            case self::DATA: {
                $value = $this->getData($key);
                break;
            }
            case self::DATA_ARRAY: {
                $value = $this->getArray($key);
                break;
            }
            case self::OBJECT: {
                $value = $this->getArray($key);
                break;
            }
        }

        return $value;
    }
396349
public function getValue() {
        if($this->input->old($this->getMeta()->name)) {
            return $this->getMeta()->getType()->transformInput($this->getMeta(), $this->input->old($this->getMeta()->name));
        } else {
            if($this->value !== null) {
                return parent::getValue();
            } else {
                return null;
            }
        }
    }
227993
public function getValueElementType()
    {
        $valueElementType = 'text';

        if ($this->getAttribute() == 'attribute_set_id') {
            $valueElementType = 'select';
        } elseif (is_object($this->getAttributeObject())) {
            $frontendInput = $this->getAttributeObject()->getFrontendInput();

            if ($frontendInput === 'boolean') {
                $valueElementType = 'select';
            } elseif ($frontendInput === 'date') {
                $valueElementType = 'date';
            } elseif (in_array($frontendInput, ['select', 'multiselect'])) {
                $valueElementType = 'multiselect';
            }
        } elseif (in_array($this->getAttribute(), array_keys($this->specialAttributesProvider->getList()))) {
            $specialAttribute = $this->specialAttributesProvider->getAttribute($this->getAttribute());
            $valueElementType = $specialAttribute->getValueElementType();
        }

        return $valueElementType;
    }
564484
public function getPhpDefaultValue()
    {
        if (null === $this->defaultValue) {
            return null;
        }

        if ($this->defaultValue->isExpression()) {
            throw new EngineException('Cannot get PHP version of default value for default value EXPRESSION.');
        }

        if (in_array($this->mappingType, [ PropelTypes::BOOLEAN, PropelTypes::BOOLEAN_EMU ])) {
            return $this->booleanValue($this->defaultValue->getValue());
        }

        if (PropelTypes::PHP_ARRAY === $this->mappingType) {
            return $this->getDefaultValueForArray($this->defaultValue->getValue());
        }
        if (PropelTypes::SET === $this->mappingType) {
            return $this->getDefaultValueForSet($this->defaultValue->getValue());
        }

        return $this->defaultValue->getValue();
    }
394340
public static function getType() : int
    {
        // Return the cached result if it's already available.
        if (null !== static::$type) {
            return static::$type;
        }

        $os = strtolower(php_uname("s"));

        // Check in order of likeliness.
        if (false !== strpos($os, 'unix')) {
            return static::$type = self::TYPE_UNIX;
        }

        if (0 === strpos($os, 'win')) {
            return static::$type = self::TYPE_WINDOWS;
        }

        if (false !== strpos($os, 'bsd')) {
            return static::$type = self::TYPE_BSD;
        }

        if (false !== strpos($os, 'darwin')) {
            return static::$type = self::TYPE_DARWIN;
        }

        if (false !== strpos($os, 'cygwin')) {
            return static::$type = self::TYPE_CYGWIN;
        }

        // Use the default otherwise.
        return static::$type = self::TYPE_UNIX;
    }