You are here: Re: multiplication math not working ? « PHP Programming Language « IT news, forums, messages
Re: multiplication math not working ?

Posted by Rik on 02/08/07 19:01

One <david.hunter@gmail.com> wrote:
> Input :
> echo "history['order_total'] is ".$history['order_total']."<br />";
> $removeit=3Dstr_replace('$' ,'', $history['order_total']);
> echo $removeit;
> $floatandremove =3D floatval($removeit);
> echo "<br />floatandremove is ".$floatandremove;
> exit;
>
> Output :
> history['order_total'] is $241.47
> 241.47
> floatandremove is 0
>

There must be something else going on with your currency string.
Please use this on that string, and report it's results back to us:

echo preg_replace('/(.)/se','"[".ord("$1")."]"',$history['order_total'])=
;
-- =

Rik Wasmus

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация