Prize format

User 1915465 Photo


Guest
16 posts

Hi all,

I was wondering :rolleyes:
Is it possible to change the format in which the prizes are published?
For example in the US the prize format for 6000 dollars and nill cents,would be:
$ 6,000.00
In Europe 6000 euro's and nill cents the notification would be:
€ 6.000,00 instead of 6,000.00
So the point is used for thousends and the comma for cents.
Is there a way to adjust/customize this?
Because the currency setting alone does not do the job.:/

Looking forward to the solution / work around.

p.s. I have SCC version 3.0

Grtz
DengKao
User 1915465 Photo


Guest
16 posts

I think I've found it.
In the file 'utilities.inc.php'
There is a piece of code:

function formatAmount ( $number, $dec_places, $lng = 'en' ) {
switch ($lng) {
case 'en':
$r = number_format($number, $dec_places, ',', '.');
break;
case 'nl':
case 'es':
$r = number_format($number, $dec_places, ',', '.');
break;
case 'fr':
$r = number_format($number, $dec_places, ',', ' ');
break;
default:
die("No definition found for language '{$lng}' in formatAmount.");
}
return $r;

The bold underlined part is what I changed...
Not bad for a newbie to PHP...
User 471275 Photo


Ambassador
1,130 posts

Deng Kao,

Well done and very handy to know this tric :)

User 1915465 Photo


Guest
16 posts

Thnx@ ad99wd,

But seems like a setting one wants to be set automatically when selecting currency.
Or by selecting Country settings.

But there is one minor issue with this work around.
That is each time you edit your shop and upload it again. You need to edit this file each time you upload the new/edited shop.

The same goes for larger prices. I managed to have a shop price of € 645.000,= to be shown. (I was practicing and I used our house as guinea-pig).
And the house is in the shop for indeed € 645.000,=
And yes I am aware that there is no pay-ment system that supports these amounts.
So I put in a link: Contact us ( < a href="mailto:yourname@yourdomain.com?subject=house for sale "> Contact us < / a>
And works perfectly...But the shopping cart functionnality is still there (but kinda useless:rolleyes::D


Guys!
One for the list: Nice to haves...(if not need to haves, for greater acceptance internationally ;) ) The format of thousands and decimals.
Please...pritty please :|

Regards,
Deng

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.