PDA

View Full Version : number_format stops calculating?

weavers94
01-08-2007, 09:02 AM
can any one let me know how to get my script to calculate past 18 quintrillion it seems to stop at a little over that amount

this is a little of the script in the number area

function net (\$id){
global \$tab;
\$pmp = mysql_fetch_array(mysql_query("SELECT whore,thug FROM \$tab[pimp] WHERE id='\$id';"));
\$net=(\$pmp[0]*67+\$pmp[1]*15);
\$net=number_format((\$net), 2, '.', '');

return"\$net";
}

function money (\$trn)
{
global \$id, \$tab;
\$pmp = mysql_fetch_array(mysql_query("SELECT hoe,payout FROM \$tab[pimp] WHERE id='\$id';"));
\$rand1=(rand(4, 8));\$rand2=(rand(5, 10));
\$money=\$trn*(rand(\$rand1, \$rand2));
\$money=(\$money*\$pmp[0]);
\$tax=round(\$money*(\$pmp[1]/50));
\$money=number_format((\$money-\$tax), 2, '.', '');

return"\$money";
}

but i cant seem to get the amount in the round to go past the 18 quintrillion mark

Fou-Lu
01-09-2007, 03:23 AM
Is the number:
18 446 744 073 709 551 615
?
If so, nothing is wrong with your code. You've simply exceeded the value of a double value.
Anyway, if this is the case, you need to start using a string representation of your number, and figuring out a way to calculate the value from there. I have no current suggestions for you, as I've never needed to deal with numbers that large (I have never exceeded the requirements of a 32 bit real number).

whizard
01-09-2007, 04:54 AM
As per the board rules (http://www.codingforums.com/rules.htm), which you agreed to when you joined, I would suggest you make every effort to avoid posting inappropriate material. I understand that it happened to be hard-coded into your script, but at codingforums, people of all ages participate, including children, and this type of material is not acceptable.

Also, I just want to point out that tho I am not a minor, I find this material to be very repulsive and vulgar.

Regards
Dan