1999 Posts in 530 Topics by 433 members
E-Commerce Modules
SilverStripe Forums » E-Commerce Modules » Currency Euro
Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.
Moderators: martimiz, Nicolaas, Howard, Sean, Ryan M., biapar, Willr, Ingo, Jedateach, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 1794 Views |
-
Currency Euro

29 June 2009 at 8:18pm
Hi,
I've made currency Euro config, but there is an'error on currency format.
Error format: 2,000.00 EUR
Good format: 2.000,00 EUR <--- how setup this? -
Re: Currency Euro

29 June 2009 at 11:23pm
Don't think it supports this yet.. you would have to make some adjustments to sapphire/core/model/fieldtypes/Currency.php
Maybe using a decorator / extension to keep upgrade capability
-
Re: Currency Euro

30 June 2009 at 8:50pm
How? Or is a localization problem?
in mysite/_config.php, I put:
i18n::enable();
i18n::set_default_lang('it_IT'); // for Ita
i18n::set_locale('it_IT'); -
Re: Currency Euro

30 June 2009 at 11:07pm
Now ok...
in currency.php , I've changed to
number_format(abs($this->value), 2,',','.');
from
number_format(abs($this->value), 2);
Bye
-
Re: Currency Euro

18 July 2009 at 11:43am
In my opinion It's advisable not to modify core classes but simply to extend them eventually overriding original methods. As an example in MyPage.php:
MyPage_CurrencyEuro extends Currency
{
protected static $currencySymbol = '€';function Nice()//or NiceEuro() if You don't want to override
{
$val = self::$currencySymbol.' '.number_format(abs($this->value), 2, ',', '.') ;
if($this->value < 0) return "($val)";
else return $val;
}
}or in a separate class-file CurrencyEuro.php
CurrencyEuro extends Currency
{
protected static $currencySymbol = '€';function Nice()
{
$val = self::$currencySymbol.' '.number_format(abs($this->value), 2, ',', '.') ;
if($this->value < 0) return "($val)";
else return $val;
}
}
| 1794 Views | ||
|
Page:
1
|
Go to Top |

