Q: Magento 2: add decimal number in the price I am using magento 2.4 and have all the products prices in this format:
9.50 ,  67.00 , 50.99

How to add another decimal number to become:
9.500 ,  67.000 , 50.990


A: For Magento 1.9.2.4 or below versions
Here you can use number_format to add that zero by:
    $price = "1234";
    $formatedNumber = number_format($price, 3, '.', '');
    echo $formatedNumber;    //Outputs -> 1234.000

Or
    $number = "105.90";
    echo number_format((float)$number, 3, '.', '');  // Outputs -> 105.900

Edit
In Magento2, you can get this by
Using this code inside your view file(.phtml)
$this->helper('Magento\Framework\Pricing\Helper\Data')->currency(number_format(8,2),true,false);

This means there can be 8 digits to the left of the decimal point (8-2) and 2 to the right of the decimal point.
Hope this will help.
