86Stang Posted August 28, 2008 Share Posted August 28, 2008 The following is an example of a problem that I must figure out and the math itself has stumped me... I have to take a number inputted from the user, say 50,000, and divide it by the number of days that they also enter with a weekend day only being worth 32.5% of a weekday. I'm already calculating how many weekdays and weekend days there are in the date range given - I just need the basic math equation. Anyone wanna help out the mathematically challenged? Quote Link to comment Share on other sites More sharing options...
akitchin Posted August 29, 2008 Share Posted August 29, 2008 simple, assuming i've understood your question correctly (which is probably a dangerous assumption). multiply the weekend days by 0.325 to get their weekday-equivalence, add the weekdays and weekday equivalents together, THEN divide: $weekdays = 56; $weekend_days = 14; $weekday_equivalence = $weekend_days * 0.325; $salary = 50000; $per_day = round($salary / ($weekdays + $weekday_equivalence), 2); the variable names are just assuming you're calculating the daily income from salary. i've also not rounded the weekday equivalence since i imagine it will make a difference. EDIT: note that here i've added in the actual division. not a significant difference, you could do so beforehand. Quote Link to comment Share on other sites More sharing options...
86Stang Posted August 29, 2008 Author Share Posted August 29, 2008 akitchin, you're one smart chemical pirate! Thanks so much!! 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.