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

Posted by One on 02/08/07 19:45

On Feb 8, 2:01 pm, Rik <luiheidsgoe...@hotmail.com> wrote:
> One <david.hun...@gmail.com> wrote:
> > Input :
> > echo "history['order_total'] is ".$history['order_total']."<br />";
> > $removeit=str_replace('$' ,'', $history['order_total']);
> > echo $removeit;
> > $floatandremove = 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

Thanks again Rik - here you go :

Input :
echo "history['order_total'] is ".$history['order_total']."<br />";
echo preg_replace('/(.)/se','"[".ord("$1")."]"',
$history['order_total']);
exit;

Output :
history['order_total'] is $241.47
[60][98][62][36][50][52][49][46][52][55][60][47][98][62]

 

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

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