Jump to content

Decimal Help


phpbeginner

Recommended Posts

Hello,

I have a quick question. I am doing a stats program for a hockey team and the question I have is that I have the decimals correct for the goaltenders goals against average and save % as I wish, except for the fact that if its an even # like 2 it will display 2 rather than 2.00. Works fine when the #'s are not even rounding off to 2 and 3 decimals respectively.

Here is the code for the GAA....

$p_array[$playerid][gaa] = ROUND('1.00' * ($p_array[$playerid][goalsa]) * (60/$p_array[$playerid][minutes]), 2);

Any help would be appreciated......thanks in advance !
Link to comment
Share on other sites

thanks, thought there may have been something I could do here in this snippet....

$p_array[$playerid][gaa] = ROUND('1.00' * ($p_array[$playerid][goalsa]) * (60/$p_array[$playerid][minutes]), 2);

like this....

$p_array[$playerid][gaa] = ROUND('1.00' * ($p_array[$playerid][goalsa]) * (60/$p_array[$playerid][minutes]), 2,'.',' ');

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.