I want to remove .000 after quantity in admin grid is there any way to remove decimal from quantity column. enter image description here

1 Answer 1


Follow the below steps for remove decimal from qty :

You need to add sequence in your module.xml file

<module name="Vendor_Module" setup_version="1.0.0">
        <module name="Magento_CatalogInventory"/>

Create product_listing.xml file at


<?xml version="1.0" encoding="UTF-8"?>
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <columns name="product_columns" class="Magento\Catalog\Ui\Component\Listing\Columns">
        <column name="qty" class="Vendor\Module\Ui\Component\Listing\Columns\QtyFile">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="filter" xsi:type="string">textRange</item>
                    <item name="add_field" xsi:type="boolean">true</item>
                    <item name="label" xsi:type="string" translate="true">Quantity</item>
                    <item name="sortOrder" xsi:type="number">75</item>

Add Renderer file QtyFile.php at



namespace Vendor\Module\Ui\Component\Listing\Columns;

class QtyFile extends \Magento\Ui\Component\Listing\Columns\Column
     * Prepare Data Source
     * @param array $dataSource
     * @return array
    public function prepareDataSource(array $dataSource)
        if (isset($dataSource['data']['items'])) {
            $fieldName = $this->getData('name');
            foreach ($dataSource['data']['items'] as & $item) {
                if (isset($item[$fieldName])) {
                    $item[$fieldName] = (int)$item[$fieldName];

        return $dataSource;

Then, Upgrade your module and clean cache.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.