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 Link to comment https://forums.phpfreaks.com/topic/114113-math-forumla/ 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 Link to comment https://forums.phpfreaks.com/topic/114113-math-forumla/#findComment-586517 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. Link to comment https://forums.phpfreaks.com/topic/114113-math-forumla/#findComment-586521 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 Link to comment https://forums.phpfreaks.com/topic/114113-math-forumla/#findComment-586531 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 Link to comment https://forums.phpfreaks.com/topic/114113-math-forumla/#findComment-586544 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: Link to comment https://forums.phpfreaks.com/topic/114113-math-forumla/#findComment-586550 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? Link to comment https://forums.phpfreaks.com/topic/114113-math-forumla/#findComment-586655 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... Link to comment https://forums.phpfreaks.com/topic/114113-math-forumla/#findComment-587198 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.... Link to comment https://forums.phpfreaks.com/topic/114113-math-forumla/#findComment-587211 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? Link to comment https://forums.phpfreaks.com/topic/114113-math-forumla/#findComment-587214 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. Link to comment https://forums.phpfreaks.com/topic/114113-math-forumla/#findComment-587215 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. Link to comment https://forums.phpfreaks.com/topic/114113-math-forumla/#findComment-587228 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 Link to comment https://forums.phpfreaks.com/topic/114113-math-forumla/#findComment-587243 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. Link to comment https://forums.phpfreaks.com/topic/114113-math-forumla/#findComment-587727 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? Link to comment https://forums.phpfreaks.com/topic/114113-math-forumla/#findComment-587814 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; Link to comment https://forums.phpfreaks.com/topic/114113-math-forumla/#findComment-587822 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.