rareness Posted May 3, 2008 Share Posted May 3, 2008 Hi guys im trying to calculate two thirds of a value ive tried a few things but im not sure how i could go about this any advice? Link to comment https://forums.phpfreaks.com/topic/103968-solved-calculating-two-thirds-of-a-value/ Share on other sites More sharing options...
Coreye Posted May 3, 2008 Share Posted May 3, 2008 Try: <?php $value = 2; $multiple = (100 / 3) * 2; $result = $value * $multiply; echo $result; ?> . Link to comment https://forums.phpfreaks.com/topic/103968-solved-calculating-two-thirds-of-a-value/#findComment-532277 Share on other sites More sharing options...
Coreye Posted May 3, 2008 Share Posted May 3, 2008 Oops, nevermind. Try this: <?php $value = 2; $multiply = (100 / 3) * 2; $result = $value * $multiply; echo $result; ?> Link to comment https://forums.phpfreaks.com/topic/103968-solved-calculating-two-thirds-of-a-value/#findComment-532290 Share on other sites More sharing options...
rareness Posted May 3, 2008 Author Share Posted May 3, 2008 Got it to work in the end echo "To Share Exp with a level ".$_POST['txtuserlvl']." the required level is : "; $value = $_POST['txtuserlvl']; $multiply = (100 / 3) * 2 /100; $result = $value * $multiply; echo round($result); Thanks alot Coreye you set me on the right path Link to comment https://forums.phpfreaks.com/topic/103968-solved-calculating-two-thirds-of-a-value/#findComment-532360 Share on other sites More sharing options...
roopurt18 Posted May 3, 2008 Share Posted May 3, 2008 (100 / 3) * 2 /100 I want you to think long and hard about what that simplifies to mathematically. Link to comment https://forums.phpfreaks.com/topic/103968-solved-calculating-two-thirds-of-a-value/#findComment-532442 Share on other sites More sharing options...
BlueSkyIS Posted May 3, 2008 Share Posted May 3, 2008 (100 / 3) * 2 /100 I want you to think long and hard about what that simplifies to mathematically. LOL Link to comment https://forums.phpfreaks.com/topic/103968-solved-calculating-two-thirds-of-a-value/#findComment-532443 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.