Menu Close
    Hire us Request quote Reading list Switch to dark mode

    Magento2 – Get Formatted Price With Currency

    Here we will see how to get formatted price with currency symbol in Magento2.

    <?php
    	$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); // Instance of Object Manager
    	$priceHelper = $objectManager->create('Magento\Framework\Pricing\Helper\Data'); // Instance of Pricing Helper
    	$price =  1000; //Your Price
    	$formattedPrice = $priceHelper->currency($price, true, false);
    ?>

    If your current currency is USD. Then output will be
    $1,000.00

    . . .

    Comments (3)

    Add Your Comment

  • Bhautik Patel
    how to remove deimal point form price ???
  • chamal_chamikara
    how to get price without $ sign ?
  • Jaime Stuardo
    I have done what it is said in this post, however, this is long version of what is already implemented in magento2 core (amount/default.phtml) template of Catalog module. When I done it, the result is a price like this: “99.990,00 $”. The post is useless as it is. The real value could be to teach a way how to format the price as language and currency require.
  • Back to Top
    css.php
    Hire Us!
    Brief us about your requirements and we'll get back to you.
    Woo! Hooy!
    We have just received your message and our expert will get back to you shortly.
    Send Again
    Close