Controlling Decimal Precision for Prices in Magento 2: Adding or Removing Custom Precision

Learn how to control the decimal precision for prices in Magento 2 Open Source software with this tutorial. Whether you need to remove decimal precision altogether or add a custom precision level, this guide provides a solution to adjust prices as per your preference.

Overview

A common issue that arises with Magento 2 is the display of prices with two decimal points by default, which can be a problem if you want to remove the decimal points or display a different number of decimal points. For instance, displaying £34.00 instead of £34 or showing £34.5 instead of £34.50.

Problem

Magento 2 displays prices with two decimal points in its frontend and admin panel by default. However, there is no configuration setting to control the decimal precision, which can be a hassle for users looking to customize the display of prices on their website.

Solution

Fortunately, the open-source community developer Lillik has created a free module: https://github.com/lillik/magento2-price-decimal that allows users to add or remove decimal precision for prices quickly. This module allows users to set the desired level of decimal precision for their prices, depending on their preference. With this module, users can easily configure the display of prices as per their needs, without needing to write additional code.

Hope this quick tip will help someone having the similar issue :)

For more quick Magento 2 tips & tricks, click here.

Leave a Reply