src/Forms/NumericField.php
protected function cast($value)
    {
        if (strlen($value) === 0) {
            return null;
        }
        if ($this->getScale() === 0) {
            return (int)$value;
        }
        return (float)$value;
    }
protected function cast($value)
    {
        if (strlen($value) === 0) {
            return null;
        }
        if ($this->getScale() === 0) {
            return (int)$value;
        }
        return (float)$value;
    }
protected function cast ( $ value ) { if ( strlen ( $ value ) === 0 ) { return null ; } if ( $ this -> getScale ( ) === 0 ) { return ( int ) $ value ; } return ( float ) $ value ; }
Helper to cast non-localised strings to their native type

@param string $value
@return float|int
Helper to cast non - localised strings to their native type