float to integer convertion

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I have this functions,  c3 and c2 that computes and return a float
number. The problem is that wen I pass the result of c2 (float number)
to c3(), in function apears to be an integer. Ex.:
$calc2=c2(params); (float number)
$calc3=c3($calc2); ($calc2 - float number)
echo $calc3; (is not the number that supposed to be, because c4
computes $calc2 as if it were an integer: if $calc=39.96 it wil be
converted in 39).

What is the problem? I really can't see it.


function c2($j,$n)
        return number_format($c,2,",",".");

function c3($calc)
        return number_format($calc,2,",",".");

Re: float to integer convertion

iulian.ilea wrote:
Quoted text here. Click to load it

$c=((16*$calc)/100)+4; --> $c variable never been used

return number_format($calc,2,",",".");  --> it will format the input
number $calc


Site Timeline