473,387 Members | 1,597 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Percentages: Not a php question, but still...

Hi,

I'm coding a PHP/MySQL application.
I'm looking for the formula to compute the original variable after it
has been applied VAT.
For instance 100 + 18% -118.
But if I try to find out 100 from 118 - 18%, the result is greater than
100.
I don't have enough maths background to solve the equation:
c = a + (a*b/100)
I'm stuck at this point:
a = (a*b/100) -c
I would like to have all 'a' on the left side and b and c on the right.

Can someone help?

Sep 1 '06 #1
7 1045
universalbitmapper wrote:
Hi,

I'm coding a PHP/MySQL application.
I'm looking for the formula to compute the original variable after it
has been applied VAT.
For instance 100 + 18% -118.
But if I try to find out 100 from 118 - 18%, the result is greater than
100.
I don't have enough maths background to solve the equation:
c = a + (a*b/100)
I'm stuck at this point:
a = (a*b/100) -c
I would like to have all 'a' on the left side and b and c on the right.

Can someone help?
We know that the selling price of £1 560 is 130% of the cost price
since the dealer is making a profit of 30% on the cost price. So we can
say
£1 560 = 130/100 + cost price
Now multiply both sides of this equation by 100 and divide both sides
by 130. This gives
100/130 X £1 560 = 100/130 X 130/100 + cost price = cost price
Since the two right-hand fractions cancel each other out.
Therefore the cost price to the dealer was £156 000/130 = £1 200.

ie 118000/118= 100

Sep 1 '06 #2
"universalbitmapper" <jb*****@gmail.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
Hi,

I'm coding a PHP/MySQL application.
I'm looking for the formula to compute the original variable after it
has been applied VAT.
For instance 100 + 18% -118.
But if I try to find out 100 from 118 - 18%, the result is greater than
100.
I don't have enough maths background to solve the equation:
c = a + (a*b/100)
I'm stuck at this point:
a = (a*b/100) -c
I would like to have all 'a' on the left side and b and c on the right.

Can someone help?

Short answer:
100 / (100+VAT) * price with VAT = original price
100 / (100+18) * 118 = 100

I don't know the correct mathematical terms, but basicly this is what
happens:
the ratio of 100 : (100 + VAT) must be the same ratio as "original price" :
"VAT price"
100 / (100 + VAT) = original price / VAT price
multiply both sides with VAT price:

==100 / (100 + VAT) * VAT price = original price * (VAT price/VAT price)
==100 / (100 + VAT) * VAT price = original price

there you have it.

--
"Ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" - lpk
http://outolempi.net/ahdistus/ - Satunnaisesti päivittyvä nettisarjis
sp**@outolempi.net || Gedoon-S @ IRCnet || rot13(xv***@bhgbyrzcv.arg)
Sep 1 '06 #3
universalbitmapper:
I'm looking for the formula to compute the original variable after it
has been applied VAT.
For instance 100 + 18% -118.
But if I try to find out 100 from 118 - 18%, the result is greater than
100.
Yes, because 18 % of 118 is greater than 18 % of 100, so 118 minus 18 %
of 118 is over 100.

Given your figures, you are trying to find x in

118/x = 118/100

that is, your figure after tax (118) divided by your figure before tax
(x) equals your tax rate(118 % not 18 %) divided by 100.

Multiplying both sides by 100,

=11800/x = 118

=118x = 11800

=x = 100

ObOT: "Standard" VAT in the UK is 17.5 %, no?

--
Jock

Sep 1 '06 #4
usenet+2...@john.dunlop.name:
universalbitmapper:
But if I try to find out 100 from 118 - 18%, the result is greater than
100.

Yes, because 18 % of 118 is greater than 18 % of 100, so 118 minus 18 %
of 118 is over 100.
Scrub that. Should be 'under 100'.

18 % of 118 is 21.24. The result is less than 100.

--
Jock

Sep 1 '06 #5
universalbitmapper wrote:
Hi,

I'm coding a PHP/MySQL application.
I'm looking for the formula to compute the original variable after it
has been applied VAT.
For instance 100 + 18% -118.
But if I try to find out 100 from 118 - 18%, the result is greater than
100.
I don't have enough maths background to solve the equation:
c = a + (a*b/100)
I'm stuck at this point:
a = (a*b/100) -c
I would like to have all 'a' on the left side and b and c on the right.

Can someone help?
We know that the selling price of £1 560 is 130% of the cost price
since the dealer is making a profit of 30% on the cost price. So we can
say
£1 560 = 130/100 + cost price
Now multiply both sides of this equation by 100 and divide both sides
by 130. This gives
100/130 X £1 560 = 100/130 X 130/100 + cost price = cost price
Since the two right-hand fractions cancel each other out.
Therefore the cost price to the dealer was £156 000/130 = £1 200.

ie 118000/118= 100

Sep 1 '06 #6
<us*********@john.dunlop.namewrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
>
ObOT: "Standard" VAT in the UK is 17.5 %, no?

Who said anything about UK? There ARE other countries. :)

--
"Ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" - lpk
http://outolempi.net/ahdistus/ - Satunnaisesti päivittyvä nettisarjis
sp**@outolempi.net || Gedoon-S @ IRCnet || rot13(xv***@bhgbyrzcv.arg)
Sep 1 '06 #7
"universalbitmapper" <jb*****@gmail.comwrote in
news:11**********************@h48g2000cwc.googlegr oups.com...
Hi,

I'm coding a PHP/MySQL application.
I'm looking for the formula to compute the original variable after it
has been applied VAT.
For instance 100 + 18% -118.
But if I try to find out 100 from 118 - 18%, the result is greater than
100.
I don't have enough maths background to solve the equation:
c = a + (a*b/100)
I'm stuck at this point:
a = (a*b/100) -c
I would like to have all 'a' on the left side and b and c on the right.

Can someone help?
price_without_wat = price_incl_vat / (100 + vat) * 100

In your example: 100 = 118 / (100 + 18) * 100

--

Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail
from another non-spammer site please.)
Sep 1 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Avinash Dhoot | last post by:
Hi, I have a 5 row table with the following values. key value 1 5 2 10 3 15 4 15 5 5
0
by: michael | last post by:
I've got a 3-column layout using percentages to define width of each div-column. #left-col { width: 20%; background-color: green; float:left; } #center-col { width: 60%; background-color: blue;...
1
by: Megan | last post by:
quick summary: i'm having problems trying to group fields in a report in order to calculate percentages. to calculate percentages, i'm comparing the results from my grouped fields to the totals....
2
by: Dot net work | last post by:
Hello. Is it possible to build up a dynamic server side table, and specify the column widths as percentages? I've tried this: Set the table width to 100%, then: FirstColumn.Width = New...
26
by: Mike Barnard | last post by:
Hi all. I am playing with html and css. I don't (yet) have a working site, I'm just trying to build a working, basic template I can use for a couple of ideas I have. I recall reading a...
5
by: Chris H | last post by:
I am wanting to write a function for a poker league manager that will detrmine players finishing points in a tournament depending on the amount of players that played... In other words when the...
1
by: Bob Alston | last post by:
I need to produce a report like this Color: # % ------ --- --- White 10 20 Black 25 50 other 15 30 ---- ---- Total 50 100
9
by: AZKing | last post by:
Hi all, I would like to know how do you go about calculating percentages in Access. For example, in a form I have 3 combo boxes with drop down menus where a user can select "Yes" or "No" and a...
3
by: martin DH | last post by:
Access 2003 I have a table (TASKS) filled with data from an external source. The table lists several tasks for employees to complete and has a text field (STATUS) that identifies where in the...
0
by: marcopolo8 | last post by:
Wierd thing is happening during my xHTML development. When I set the width attribute of a text field in a form and use percentages, if the text field's value is extremely long, IE6 automatically...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.