Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How To Add Space After Currency Symbol


PerwiraUtama

Recommended Posts

But I think this messes up the e-mails that are sent to customers, unless you send them in html. Had a mess somewhat to get the e-mails different.

I have used it before the symbol right, and it does not affect text emails:

Zone Rates (Australia Post Air Parcel (no insurance) to Australia: 0.48 kg(s)): $10.00 AUD

Link to comment
Share on other sites

This is part of my file ../classes/curencies.php

 

// class methods
function format($number, $calculate_currency_value = true, $currency_type = '', $currency_value = '') {
  global $currency;

  if (empty($currency_type)) $currency_type = $currency;

  if ($calculate_currency_value == true) {
	$rate = (tep_not_null($currency_value)) ? $currency_value : $this->currencies[$currency_type]['value'];
	$format_string = $this->currencies[$currency_type]['symbol_left'] . ' ' . number_format(tep_round($number * $rate, $this->currencies[$currency_type]['decimal_places']), $this->currencies[$currency_type]['decimal_places'], $this->currencies[$currency_type]['decimal_point'], $this->currencies[$currency_type]['thousands_point']) . ' ' . $this->currencies[$currency_type]['symbol_right'];
// if the selected currency is in the european euro-conversion and the default currency is euro,
// the currency will displayed in the national currency and euro currency
	if ( (DEFAULT_CURRENCY == 'EUR') && ($currency_type == 'DEM' || $currency_type == 'BEF' || $currency_type == 'LUF' || $currency_type == 'ESP' || $currency_type == 'FRF' || $currency_type == 'IEP' || $currency_type == 'ITL' || $currency_type == 'NLG' || $currency_type == 'ATS' || $currency_type == 'PTE' || $currency_type == 'FIM' || $currency_type == 'GRD') ) {
	  $format_string .= ' <small>[' . $this->format($number, true, 'EUR') . ']</small>';
	}
  } else {
	$format_string = $this->currencies[$currency_type]['symbol_left'] . ' ' . number_format(tep_round($number, $this->currencies[$currency_type]['decimal_places']), $this->currencies[$currency_type]['decimal_places'], $this->currencies[$currency_type]['decimal_point'], $this->currencies[$currency_type]['thousands_point']) . ' ' . $this->currencies[$currency_type]['symbol_right'];
  }

  return $format_string;
}

 

I added

. ' ' .

after "symbol_left" and before "symbol_right"

if you compare this code and original then you will see it clear

 

thats all

Link to comment
Share on other sites

This is part of my file ../classes/curencies.php

 

// class methods
function format($number, $calculate_currency_value = true, $currency_type = '', $currency_value = '') {
  global $currency;

  if (empty($currency_type)) $currency_type = $currency;

  if ($calculate_currency_value == true) {
	$rate = (tep_not_null($currency_value)) ? $currency_value : $this->currencies[$currency_type]['value'];
	$format_string = $this->currencies[$currency_type]['symbol_left'] . ' ' . number_format(tep_round($number * $rate, $this->currencies[$currency_type]['decimal_places']), $this->currencies[$currency_type]['decimal_places'], $this->currencies[$currency_type]['decimal_point'], $this->currencies[$currency_type]['thousands_point']) . ' ' . $this->currencies[$currency_type]['symbol_right'];
// if the selected currency is in the european euro-conversion and the default currency is euro,
// the currency will displayed in the national currency and euro currency
	if ( (DEFAULT_CURRENCY == 'EUR') && ($currency_type == 'DEM' || $currency_type == 'BEF' || $currency_type == 'LUF' || $currency_type == 'ESP' || $currency_type == 'FRF' || $currency_type == 'IEP' || $currency_type == 'ITL' || $currency_type == 'NLG' || $currency_type == 'ATS' || $currency_type == 'PTE' || $currency_type == 'FIM' || $currency_type == 'GRD') ) {
	  $format_string .= ' <small>[' . $this->format($number, true, 'EUR') . ']</small>';
	}
  } else {
	$format_string = $this->currencies[$currency_type]['symbol_left'] . ' ' . number_format(tep_round($number, $this->currencies[$currency_type]['decimal_places']), $this->currencies[$currency_type]['decimal_places'], $this->currencies[$currency_type]['decimal_point'], $this->currencies[$currency_type]['thousands_point']) . ' ' . $this->currencies[$currency_type]['symbol_right'];
  }

  return $format_string;
}

 

I added

. ' ' .

after "symbol_left" and before "symbol_right"

if you compare this code and original then you will see it clear

 

thats all

Thank you Qihun, this is the best solution yet.

Link to comment
Share on other sites

  • 3 months later...

Hi

I have tried Coopco solution.

It worked well but I have noticed that it interfere within one page

Scrub>>My Account » History » Order #15

 

The currency symbol £ or $ seems to be in a different line than the price

 

Display in this specific page

Total: £

1,255.00

 

Took away the . ' ' . and left only a . and it came back to normal.

 

Previous history seems to be snapshot of an order and will not be modified by anything than delete.

So you need to do a new order to see if it all take place right.

 

Few 'funny' things have happened recently to my site with me not doing much. I know my host mentionned issues between db and osCommerce.

Could this be related?

I hope it helps

Link to comment
Share on other sites

Hi

I have tried Coopco solution.

It worked well but I have noticed that it interfere within one page

Scrub>>My Account » History » Order #15

 

The currency symbol £ or $ seems to be in a different line than the price

 

Display in this specific page

Total: £

1,255.00

 

Took away the . ' ' . and left only a . and it came back to normal.

 

Previous history seems to be snapshot of an order and will not be modified by anything than delete.

So you need to do a new order to see if it all take place right.

 

Few 'funny' things have happened recently to my site with me not doing much. I know my host mentionned issues between db and osCommerce.

Could this be related?

I hope it helps

Not my solution, Qihun's solution.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...