Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

How do you get rid of the trailling zeroes when using getPrice()? 
 
thomasmore
Sr. Member
 
Total Posts:  80
Joined:  2008-10-21
 

<?php echo $this->htmlEscape($_product->getPrice()) ?>

Right now that’s the title tag I am using to display price, but 15.50 will show up as 15.5000. How do I remove the extra zeroes?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Discovery
Enthusiast
 
Total Posts:  767
Joined:  2007-12-29
 

There is a helper app to display price with currency, open up the code blocks for prices and look for how it’s done, e.g.:

<?php echo Mage::helper('core')->currency($_finalPrice,true,false) ?>
<?php echo Mage::helper('core')->currency($_finalPriceInclTax,true,false) ?>

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top