MikeDXUNL Posted July 10, 2008 Share Posted July 10, 2008 365 points 18 of 50 36% Complete (18 of 50) I know the game has 1000 points but the script doesn't. Is there a formula which can be created to tell the script how much complete points are available (in this case 1000) Thanks in Advance Quote Link to comment Share on other sites More sharing options...
rmbarnes82 Posted July 10, 2008 Share Posted July 10, 2008 Hi, The answer to your question is yes and no. Yes you can reach the figure 1000 from the numbers given, but only if you use a higher precision. Based on 365 points being 36%, the total points would come out at around 1013. The correct percentage is 36.5%. Using this we can get 100: <?php $currentPoints = 365; $currentPercentage = 36.5; $totalPoints = (100 / $currentPercentage) * $currentPoints; Robin Quote Link to comment Share on other sites More sharing options...
DarkWater Posted July 10, 2008 Share Posted July 10, 2008 Yeah, Mike, you need to use exact percentages for it. @_@ It's just a proportion really. Quote Link to comment Share on other sites More sharing options...
mbeals Posted July 10, 2008 Share Posted July 10, 2008 where is the 18 / 50 coming from? because 18 / 50 is .36, but 365 / 1000 is .365 Quote Link to comment Share on other sites More sharing options...
MikeDXUNL Posted July 10, 2008 Author Share Posted July 10, 2008 18 of 50 is how many achievements they have. so those 18 = 365 points the 36% is coming from 18/50 not 365/1000 Quote Link to comment Share on other sites More sharing options...
MikeDXUNL Posted July 10, 2008 Author Share Posted July 10, 2008 Actually, I think i figured it out with a Proportion. 18 = 365 50 X EDIT edit. that actually gives me 1013 D: Quote Link to comment Share on other sites More sharing options...
Barand Posted July 10, 2008 Share Posted July 10, 2008 Can't you change the 365 to 360? Quote Link to comment Share on other sites More sharing options...
MikeDXUNL Posted July 11, 2008 Author Share Posted July 11, 2008 no, you can't. i have 18 achievements and those 18 acheivements are worth 365 points. not 360... Quote Link to comment Share on other sites More sharing options...
corbin Posted July 11, 2008 Share Posted July 11, 2008 I get the feeling you need to tell us more information.... Quote Link to comment Share on other sites More sharing options...
Andy-H Posted July 11, 2008 Share Posted July 11, 2008 Why dont you just change the achievements to a ratio of 20:1? Quote Link to comment Share on other sites More sharing options...
DarkWater Posted July 11, 2008 Share Posted July 11, 2008 They're not always worth 20 points each. Quote Link to comment Share on other sites More sharing options...
MikeDXUNL Posted July 11, 2008 Author Share Posted July 11, 2008 That's really all there is too it. Someone has ##1 of ## achievements ##1 are worth so many points. (in this case I have 18 of 50 achievements. and those 18 are worth 365 points.) I need to find how many total points there are. i know for this game there are 1000. So I need to find X but: 18 = 365 50 X doesnt work. Quote Link to comment Share on other sites More sharing options...
auro Posted July 11, 2008 Share Posted July 11, 2008 hi friend! How are you? Are you limiting the total points to 1000 yourself? Or there is any formula you are using to limit it? I mean eg. 50 questions of 20 points each etc. I think you are rounding of your 365/1000 to get 18/50 Quote Link to comment Share on other sites More sharing options...
MikeDXUNL Posted July 11, 2008 Author Share Posted July 11, 2008 hi friend! How are you? Are you limiting the total points to 1000 yourself? Or there is any formula you are using to limit it? I mean eg. 50 questions of 20 points each etc. I think you are rounding of your 365/1000 to get 18/50 no. that's a complete incorrect statement. Quote Link to comment Share on other sites More sharing options...
discomatt Posted July 11, 2008 Share Posted July 11, 2008 If the points per achievement are variable its impossible to have a % that works for both at the same time. If you are storing your points per achievement in a database, why not pull the SUM of all points? Quote Link to comment Share on other sites More sharing options...
DarkWater Posted July 11, 2008 Share Posted July 11, 2008 Yeah, that's what I told him. SELECT SUM(a.achpoints) AS totalpoints FROM achievements AS a WHERE a.gameid = $game; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.