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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • universalbitmapper

    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?

  • davie

    #2
    Re: Percentages: Not a php question, but still...

    universalbitmap per 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

    Comment

    • Kimmo Laine

      #3
      Re: Percentages: Not a php question, but still...

      "universalbitma pper" <jbmorla@gmail. comwrote in message
      news:1157093880 .725466.161370@ h48g2000cwc.goo glegroups.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
      spam@outolempi. net || Gedoon-S @ IRCnet || rot13(xvzzb@bhg byrzcv.arg)


      Comment

      • usenet+2004@john.dunlop.name

        #4
        Re: Percentages: Not a php question, but still...

        universalbitmap per:
        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

        Comment

        • usenet+2004@john.dunlop.name

          #5
          Re: Percentages: Not a php question, but still...

          usenet+2...@joh n.dunlop.name:
          universalbitmap per:
          >
          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

          Comment

          • davie

            #6
            Re: Percentages: Not a php question, but still...

            universalbitmap per 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

            Comment

            • Kimmo Laine

              #7
              Re: Percentages: Not a php question, but still...

              <usenet+2004@jo hn.dunlop.namew rote in message
              news:1157098770 .725070.277100@ i42g2000cwa.goo glegroups.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
              spam@outolempi. net || Gedoon-S @ IRCnet || rot13(xvzzb@bhg byrzcv.arg)


              Comment

              • Petr Vileta

                #8
                Re: Percentages: Not a php question, but still...

                "universalbitma pper" <jbmorla@gmail. comwrote in
                news:1157093880 .725466.161370@ h48g2000cwc.goo glegroups.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_w at = 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.)


                Comment

                Working...