Results 1 to 3 of 3

Math Help - % problem

  1. #1
    Newbie
    Joined
    Mar 2006
    Posts
    2

    % problem

    Hi all
    I hope someone may be able to help me as it includes a problem in programming so i may not be in the right place if not then sorry.

    I want to - 75% from a number

    eg Price = Price - 75%

    With Price = 7 i get -68 when it should be 1.75.

    Im sure this has something to do with the way i write the code and wondered if anyone has any idea how to do this in any programing language.

    As i say i might be in wrong place but worth a try.

    Thanks to all
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by mohawk523
    Hi all
    I hope someone may be able to help me as it includes a problem in programming so i may not be in the right place if not then sorry.

    I want to - 75% from a number

    eg Price = Price - 75%

    With Price = 7 i get -68 when it should be 1.75.

    Im sure this has something to do with the way i write the code and wondered if anyone has any idea how to do this in any programing language.

    As i say i might be in wrong place but worth a try.

    Thanks to all
    75% means 75/100 or 0.75.
    75% of a number N, is 0.75N

    So if you take 75% form N you are left with N-0.75N=0.25N.

    Your code should look something like:

    price=0.25*price;

    RonL
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Mar 2006
    Posts
    2

    %%%%????

    Thanks il work with that
    Follow Math Help Forum on Facebook and Google+

Search Tags


/mathhelpforum @mathhelpforum