Magento 2: Get a Formatted Price with Currency Symbol

Magento 2: Get a Formatted Price with Currency Symbol

Get a Magento 2 formatted price with the store currency symbol using the pricing helper — one short, reusable snippet for any template.

Magento 2 : How to get formatted price with currency

<?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);
?>

 

Further reading: Adobe Commerce PHP developer guide. Need a hand? Our Magento development team can help.

Need a hand?

Stuck on a build?
Let's solve it together.

Our engineers fix, upgrade and scale Magento, WordPress and modern stacks every day.