Add space in after currency sign in magento

Add space in after currency sign in magento

August 26, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Add space in after currency sign in magento

Adding Space After Currency Symbol in Magento 1.7

If you’re working with Magento 1.7 and want to add space after the currency symbol in your store’s product listings, you’ve come to the right place. In this guide, we’ll walk you through a simple yet effective way to achieve this.

Understanding the Currency Format Issue

By default, Magento doesn’t include any space between the currency symbol (VEB) and the value (12.98). This lack of spacing can make your product listings look cramped or incorrectly formatted, especially if you’re dealing with currencies that have a significant value like Bolivian Boliviano.

The Solution: Modify the Currency Options

To add this missing space, we’ll need to modify the currency options in Magento’s core files. Here are the steps:

  1. Open your Magento 1.7 installation using an FTP client or SSH.
  2. Navigate to the following directory: app/code/core/Mage/Directory/Model/Currency.php
  3. Locate line 408, which contains the format function.

The relevant code section looks like this:

public function format($price, $precision = 2)
{
    $formattedPrice = number_format($price * $this->getRate(), $precision, ',', '.');
    return $formattedPrice;
}
  1. Replace the number_format line with the following modified version:
$formattedPrice = number_format($price * $this->getRate(), $precision, ',', ' . ');
return $formattedPrice;

Notice the added space right after the .:

... '.', ' . ';

This change tells PHP to add a space character before the decimal point in your currency values.

  1. Save the changes and close the file.
  2. Flush the Magento cache from the admin panel (System > Cache Management) or use a console command: php magento_cache_flush.

Verifying the Changes

After implementing these modifications, visit your product listing page again. You should now see the Bolivian Boliviano currency displayed with an added space after the symbol:

VEB . 12.98

The space character (.) is now clearly visible between the symbol and the value.

Conclusion: Customizing Currency Format in Magento

Adding a space after the currency symbol in Magento involves a simple core file modification. This technique demonstrates how to customize Magento’s built-in functions for specific formatting requirements like adding extra spaces or adjusting decimal points.

Remember, when modifying core files, always create a backup first and test changes thoroughly on a staging environment before applying them to your production site.

For more advanced customization options in Magento, consider exploring the extensions available at Laravel Company. These tools can help you extend Magento’s functionality without directly modifying core files.

Magento 1 Catalog Pricing Errors

Our network