Maths advice please-deducting first set of values, then more

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: Maths advice please-deducting first set of values, then

Post by simonmlewis »

Ok thank you very much for your addition.
The other way does seem to produce the right result in about 2 lines! When you have many of these calcs to do, two lines seem a little 'tidier'.

But I did ask how your way was better, or if it is more accurate etc.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: Maths advice please-deducting first set of values, then

Post by social_experiment »

simonmlewis wrote:But I did ask how your way was better, or if it is more accurate etc.
I guess the 'better' would depend on the criteria, (in this case amount of code) then no, it's not better. As for more accurate, i think the accuracy is the same because the base formula for determining a percentage is pretty standard, as are the results. :) Hope this answers the question you asked
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: Maths advice please-deducting first set of values, then

Post by simonmlewis »

It does, thank you for your help.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
Post Reply