Magento: Price, formatted but without currency symbol

Magento: Price, formatted but without currency symbol

August 17, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento: Price, formatted but without currency symbol

Formatting Magento Prices Without Currency Symbol: A Comprehensive Guide

Magento offers extensive built-in functionality for handling pricing, including currency formatting. However, when you need to display a price without the currency symbol, the standard core functions may not provide the exact output you require. This guide will walk you through how to achieve this using only Magento’s default features.

Understanding the Currency Formatting

By default, Magento uses Mage::helper('core')->formatPrice() to format prices with a currency symbol. The second parameter of this function, when set to false, excludes the currency symbol:

$formatted_price = Mage::helper('core')->formatPrice($product->getFinalPrice(), false);

This will return the price as 19,99 for an item with a final price of €19.99. However, this function still includes the thousand separator (19,99), which might not be desired in all contexts.

Using Custom Helper Methods

To bypass the built-in formatting and achieve a cleaner output without any separators or currency symbols, you can create a custom helper method. This method will simply return the price as a string with no additional formatting:

class My_Module_Helper extends Mage_Core_Helper_Abstract
{
    public function formatPrice($price)
    {
        return $price;
    }
}

In your module configuration, ensure you’ve declared this helper in the config.xml file:

<helpers>
    <my_module>
        <class>My_Module_Helper</class>
    </my_module>
    ...
</helpers>

Implementing the Custom Helper

Now, to use this custom helper method, you can call it like any other Magento helper:

$formatted_price = Mage::helper('mymodul')->formatPrice($product->getFinalPrice());

This will return 19.99 for an item with a final price of €19.99, removing the currency symbol and any separators.

Best Practices

While this solution gets the job done, it’s important to consider some best practices:

  • Use Modularity: Always create a separate module for this kind of customization. This keeps your core Magento files clean and makes updating easier.
  • Performance Considerations: While this method is simple, if you’re formatting prices extensively on high-traffic pages, the additional helper calls could impact performance. Monitor and optimize as needed.

Remember, when working with pricing in Magento, always ensure your store’s settings are configured correctly for tax calculation, currency conversion, and any special pricing rules that might apply to your products.

Conclusion

In conclusion, while Magento’s built-in functions offer powerful formatting capabilities, sometimes you need a cleaner output without the standard currency symbol or separators. By creating a custom helper method, you can achieve this without resorting to manual string manipulation.

This approach ensures you’re leveraging Magento’s architecture effectively and keeping your code clean and maintainable. To learn more about advanced Magento customizations like this one, be sure to explore our comprehensive guides at LaravelCompany.com.

Catalog Extensions Configuration Pricing

Our network