will1329 Posted August 21, 2010 Share Posted August 21, 2010 Hello, I am trying to inculde a quick quote function on my website that will allow customers to get a rough price guide. However, I don't really have any idea of how to do it and it seems quite complicated. The price is calculated by the number of words divided by 300, time 13, divided by 60 (then rounded up and times by 40. I would then like to display a 5% range (e.g so instead of £100 it would show £95-£105). I've attached an image displaying an example and the formulas in excel if it helps. Thanks you very much for any help, Will1329 [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/211385-php-estimate-cost-formula/ Share on other sites More sharing options...
Daniel0 Posted August 21, 2010 Share Posted August 21, 2010 function getCostEstimate($words, $range = 0.05) { $base = ceil($words * 13 / 60) * 40; return array($base * (1 - $range), $base * (1 + $range)); } Quote Link to comment https://forums.phpfreaks.com/topic/211385-php-estimate-cost-formula/#findComment-1102174 Share on other sites More sharing options...
will1329 Posted August 22, 2010 Author Share Posted August 22, 2010 Thanks for the reply but how would I put this in? thanks, Will1329 Quote Link to comment https://forums.phpfreaks.com/topic/211385-php-estimate-cost-formula/#findComment-1102394 Share on other sites More sharing options...
Daniel0 Posted August 22, 2010 Share Posted August 22, 2010 How would I know? I haven't even seen your code... Quote Link to comment https://forums.phpfreaks.com/topic/211385-php-estimate-cost-formula/#findComment-1102405 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.