سؤال

When I am adding column of TYPE_DECIMAL like this

->addColumn(
    'credit',
    Table::TYPE_DECIMAL,
    null,
    ['nullable' => false, 'default' => '0.00', 'length' => '10,2'],
    'Decimal'
)

Not giving decimal length in 10,2 it makes 10,0 Why? Any idea?

هل كانت مفيدة؟

المحلول

You should define the length passing as third parameter.

->addColumn(
    'credit',
    Table::TYPE_DECIMAL,
    '10,2',
    ['nullable' => false, 'default' => '0.00'],
    'Decimal'
)
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى magento.stackexchange
scroll top