Attribute default value is always being saved as an int Following block in generateColumnDefinition($config) function in DbHelper.php class is always converting default value to int if it is a numeric value. A numeric value can be a float so this is causing an issue:

if (isset($config['default']) &amp;&amp; (is_string($config['default']) || is_bool($config['default']) || is_numeric($config['default'])))
{
    if (is_string($config['default']) &amp;&amp; !is_numeric($config['default']))
    {
        $def .= ' DEFAULT "'.$config['default'].'"';
    }
    else
    {
        $def .= ' DEFAULT '.(int)$config['default'];
    }
}


Is there a way that I can override this method? Any help much appreciated.

Many thanks
You can’t override that method from a plugin, if you really think it should be changed I’d suggest to file a feature request.

As a workaround you could try to set a default manually before the attribute is stored to the database or before the value is used. If it’s for a custom field type you could look into utilizing prepValue or prepValueFromPost for example.