|
Posted by nescio on 11/15/05 21:22
hello,
i have got a variable with the value '$rij[2] = "16.60" (it is the price of
something);
but i want this value to be a integer or a double, because i need to know
how many cents the amount is.
i have tried 'settype($variable, "double"); but it is not working;
---------------source code ---------------------------
function bedragInCenten($bedrag){
$nieuw = settype($bedrag, "double");
$nieuw = $nieuw * 100;
return $nieuw;
}
$demo = "16.60";
bedragInCenten($demo);
--------------------------------------------------------
i always get '100' as an outcome.
can someone explain this to me, and show me how to do it wright?
thanks
Navigation:
[Reply to this message]
|