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
Categories:
Magento2
Tags:
Formatted Price
View Comments (3)
Comment or Ask a Question
Quick Links