The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
|
#1
|
|||
|
|||
Calculations part 2
Ok im trying to calculate % weight loss
Right now i have $post['percentlost'] = ceil(intval($post['weightlost']) / intval($post['leftlose']+$post['weightlost']) * 100); BUT this is not calculating what i need it is calculating % lost of my goal i need it to calculate my total % of weight loss HEre are the stats Starting Weight: 268 lbs This is field 10 Current Weight: 265 lbs This is field 11 Goal Weight: 235 lbs This is field12 Weight Lost: 3 lbs This is weightlost Left to Lose: 30 lbs This is leftlose Percent Lost: 10 % this is percentlost I believe this is the formula used to calculate % lost Original Weight minus Current Weight Now divide your answer by your Original Weight then multiply by 100 --------------- Added [DATE]1227733026[/DATE] at [TIME]1227733026[/TIME] --------------- wouldnt it be $post['percentlost'] = ceil(intval($post['field10']) - intval($post['field11']) / intval($post['field10']) * 100); ??? but for some reason that gives me 170 % |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|