Hi Stefan,
// processing amounts
$dAmount = str_replace( ',', '.', $dAmount );
if ( !$this->getConfig()->getConfigParam( 'blAllowUnevenAmounts' ) ) {
$dAmount = round( ( string ) $dAmount );
}
- "str_replace" returns mixed (string or array)
- "round" can't casts arrays, so they must cast the result of
"str_replace" to string. ;-)
Am 15.09.2010 09:36, schrieb Stefan Krenz:
> Hi,
>
> when I was looking for a good starting-point to import data into the
> OXID eShop, I found a unecessary type cast, in file
> admin/artcile_stock.php on lines 146 and 147. There is a type cast from
> string to string and then into a float, in a single statement.
>
> Two similar type casts can be found in the following files.
>
> File: views/oxcmp_utils.php
> Line: 208
>
> File: core/oxinputvalidator.php
> Line: 93
>
> What is the meaning behind the type casts?
>
> Regards Stefan
>
_______________________________________________
dev-general mailing list
[email protected]
http://dir.gmane.org/gmane.comp.php.oxid.general
--
Steven Klar Mayflower GmbH
Pleichertorstraße 2 Tel.: +49 931 359 65 1157
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