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

    Searching for an experienced
    Magento 2 Company ?
    Read More
    . . .
    Add a comment

    Leave a Comment

    Your email address will not be published. Required fields are marked*


    3 comments

  • 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
    I have tested and used Webkul Marketplace extension for years under Odoo and now recently also deployed it under Magento 2 and I have to say that not only the code is responsive but also the team :-) Working hard and politely on my little nerdy requests, bug fixing and customization.
    Mohamed Es Fih
    eSolutions for Business Adviser
    www.intracen.org
    Talk to Sales

    Global

    Live Chat

    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home