Hello developers,
I would suggest to implement this in a module for oxlang.
Feel free and make a proper module if you want.
I haven't done it yet (had some compatibility issues with another
module), but here is my code:
public function formatCurrency( $dValue, $oActCur = null )
{
if ( !$oActCur ) {
$oActCur = $this->getConfig()->getActShopCurrencyObject();
}
$sDecSep = $oActCur->dec;
$sThousandSep = $oActCur->thousand;
if (!($this->translateString('DECIMAL_SEPERATOR') ===
'DECIMAL_SEPERATOR')) {
$sDecSep = $this->translateString('DECIMAL_SEPERATOR');
}
if (!($this->translateString('THOUSAND_SEPERATOR') ===
'THOUSAND_SEPERATOR')) {
$sThousandSep =
$this->translateString('THOUSAND_SEPERATOR');
}
return number_format( (double)$dValue, $iRound, $sDecSep,
$sThousandSep );
}
For "formatVat" it should be done in a similar way.
Now just add DECIMAL_SEPERATOR and THOUSAND_SEPERATOR to cust_lang.php
and it would override the currency setting for the seperators.
I haven't checked though if this ould have side effects somewhere
else...
Have a nice weekend,
Martin
>>> "Marco Steinhaeuser" <[email protected]>
22.10.2010 15:52 >>>
Hi Martin,
do you by chance consider to opensource this module? Would be a good
step in a manner of internationalization ;)
Regards
Marco
-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von
Daniel
Gesendet: Freitag, 22. Oktober 2010 15:33
An: [email protected]
Betreff: Re: [oxid-dev-general] decimal separator not only dependant
oncurrency
Am 22.10.2010 15:19, schrieb [email protected]:
> Hello developers,
> currently the decimal and thousands separator are dependant on the
chosen currency.
> Sometimes you may also want to have it dependant on the chosen
language.
> E.g. in English speaking countries the dot is used as decimal
separator.
> Now if you have a shop that's only running in Euro, people from UK or
Ireland would expect to have a decimal point instead of the comma.
> Anyone having this issue, too?
> Any ideas how to implement this?
>
> Regards,
> Martin
>
>
> _______________________________________________
> dev-general mailing list
> [email protected]
> http://dir.gmane.org/gmane.comp.php.oxid.general
Hi Martin,
we solved this by extending oxarticle and overwriting the method
getFPrice().
There you can include your own logic how to format price outputs.
Best regards,
--
Daniel Schlichtholz Mayflower GmbH
Pleichertorstraße 2 Tel.: +49 931 359 65 1125
D-97070 Würzburg Fax : +49 931 359 65 28
[email protected] http://www.mayflower.de
Mayflower GmbH, Standort Würzburg
Firmensitz: Mannhardtstraße 6, 80538 München
Registergericht: Amtsgericht München, HRB 142039
Geschäftsführer: Gregor Streng, Björn Schotte, Albrecht Günther,
Johann-Peter Hartmann
_______________________________________________
dev-general mailing list
[email protected]
http://dir.gmane.org/gmane.comp.php.oxid.general
_______________________________________________
dev-general mailing list
[email protected]
http://dir.gmane.org/gmane.comp.php.oxid.general
_______________________________________________
dev-general mailing list
[email protected]
http://dir.gmane.org/gmane.comp.php.oxid.general