I want to remove decimal points for price in product admin grid.

enter image description here

I have follow this but it only remove the decimal from frontend.

2 Answers 2


in file vendor/magento/module-catalog/Ui/Component/Listing/Columns/Price.php

change line number 65

$item[$fieldName] = $currency->toCurrency(sprintf("%f", $item[$fieldName]));


$item[$fieldName] = round($item[$fieldName]);


  • Thanks @Jigs it working for me Commented Jan 17, 2020 at 9:21
  • @PurushotamSharma it will create issue when are going to upgrade magento 2 version. give specific solution to override this in your local module
    – liyakat
    Commented Jan 17, 2020 at 9:32
  • @Jigs: it also removed Currency symbol from price Commented Jan 17, 2020 at 10:16
  • yes it remove the currency symbol, if you dont want to remove it, than you need to just change in the same line Commented Jan 20, 2020 at 5:11

I have override this using custom module:-





<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Vendor_Module" setup_version="1.0.0">
            <module name="Magento_Catalog"/>


<?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="price" class="Vendor\Module\Ui\Component\Listing\Columns\Price">
            <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">Price</item>
                    <item name="sortOrder" xsi:type="number">74</item>



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

use Magento\Framework\View\Element\UiComponentFactory;
use Magento\Framework\View\Element\UiComponent\ContextInterface;

class Price extends \Magento\Ui\Component\Listing\Columns\Column
     * Column name
    const NAME = 'column.price';

     * @var \Magento\Framework\Locale\CurrencyInterface
    protected $localeCurrency;

     * @param ContextInterface $context
     * @param UiComponentFactory $uiComponentFactory
     * @param \Magento\Framework\Locale\CurrencyInterface $localeCurrency
     * @param \Magento\Store\Model\StoreManagerInterface $storeManager
     * @param array $components
     * @param array $data
    public function __construct(
        ContextInterface $context,
        UiComponentFactory $uiComponentFactory,
        \Magento\Framework\Locale\CurrencyInterface $localeCurrency,
        \Magento\Store\Model\StoreManagerInterface $storeManager,
        array $components = [],
        array $data = []
    ) {
        parent::__construct($context, $uiComponentFactory, $components, $data);
        $this->localeCurrency = $localeCurrency;
        $this->storeManager = $storeManager;

     * Prepare Data Source
     * @param array $dataSource
     * @return array
    public function prepareDataSource(array $dataSource)
        if (isset($dataSource['data']['items'])) {
            $store = $this->storeManager->getStore(
                $this->context->getFilterParam('store_id', \Magento\Store\Model\Store::DEFAULT_STORE_ID)
            $currency = $this->localeCurrency->getCurrency($store->getBaseCurrencyCode());

            $fieldName = $this->getData('name');
            foreach ($dataSource['data']['items'] as & $item) {
                if (isset($item[$fieldName])) {
                    //$item[$fieldName] = $currency->toCurrency(sprintf("%f", $item[$fieldName]));
                    $item[$fieldName] = round($item[$fieldName]);

        return $dataSource;

Hope this will help.

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.