This is a Magento CE 2.3.2 project
In this project we need to work with 4 decimals for prices. We have tried this https://github.com/lillik/magento2-price-decimal which works fine, all prices are printed with 4 decimals in frontend, calculations are fine, and values are registered with 4 decimals in database tables when updating data through import/export functionality, or saving a product in admin, if we enter 4 decimal values
We have only 1 problem, but a big problem. In admin, in product edit page the html price input's are showing the value rounded to 2 decimals. So if we have a product with a price 1000.9555 €, if some admin user changes just one single letter in product's description then the rounded price value which is shown in the input (1000.96) is sent to form & saved, overwriting it to 1000.9600 in database
We have spent some days trying to find which template / js is responsible to print that form element, with no success. Any tips?
Best Answer
You may try the step below for this customization:
I assume you are using a custom module name "Company_MyModle"
step 1)
Create a di.xml file under MAGETNTO-ROOT/app/code/Company/Company_MyModle/etc/adminhtml
File : di.xml
step 2)
Create the file Price.php under MAGETNTO-ROOT/app/code/Company/MyModle/Ui/DataProvider/Product/Modifier
File : Price.php
step 3) Run di.compile