Posted by Kimmo Laine on 02/15/07 18:00
pipe.jack@gmail.com kirjoitti:
> I'm trying to convert string to float and my float after conversion is
> 0 (zero). Here is my code:
>
> $c = $currencies->format($cart->show_total());
> echo gettype($c);
> echo (float)$c;
>
> $c = 39.59
> gettype($c) = string
> echo (float)$c; = 0
>
> any other string such as "2.34" converted into float exactly the same
> way works fine.
>
> Thanks,
> JP
>
What does $currencies->format() do and why wouldn't you just use the
$cart->show_total()?
--
"En ole paha ihminen, mutta omenat ovat elinkeinoni." -Perttu Sirviö
spam@outolempi.net | Gedoon-S @ IRCnet | rot13(xvzzb@bhgbyrzcv.arg)
Navigation:
[Reply to this message]
|