A bit of math logic please

Discussion in 'ASP .Net' started by catherine@myoddjobs.info, Jul 6, 2007.

  1. Guest

    Hi, basically I need a function which will return a number for...

    Given a number n (Say 800px) by what factor do I need to shrink it to
    get it as close to but not over 300px?

    Bear in mind that the number n may be 301px or 1638px

    Thanks for any help!
    Kate
     
    , Jul 6, 2007
    #1
    1. Advertising

  2. wrote:
    > Hi, basically I need a function which will return a number for...
    >
    > Given a number n (Say 800px) by what factor do I need to shrink it to
    > get it as close to but not over 300px?
    >
    > Bear in mind that the number n may be 301px or 1638px


    That's not a number. Lets work with numbers.

    The factor is simply 300/n.

    300/800 = 0.375

    800 * 0.375 = 300

    --
    Göran Andersson
    _____
    http://www.guffa.com
     
    =?ISO-8859-1?Q?G=F6ran_Andersson?=, Jul 6, 2007
    #2
    1. Advertising

  3. Guest

    On Jul 6, 7:54 pm, Göran Andersson <> wrote:
    > wrote:
    > > Hi, basically I need a function which will return a number for...

    >
    > > Given a number n (Say 800px) by what factor do I need to shrink it to
    > > get it as close to but not over 300px?

    >
    > > Bear in mind that the number n may be 301px or 1638px

    >
    > That's not a number. Lets work with numbers.
    >
    > The factor is simply 300/n.
    >
    > 300/800 = 0.375
    >
    > 800 * 0.375 = 300
    >
    > --
    > Göran Andersson
    > _____http://www.guffa.com


    Thank you!
     
    , Jul 6, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    1,809
    Timothy Bendfelt
    Jan 19, 2007
  2. Replies:
    9
    Views:
    1,013
    Juha Nieminen
    Aug 22, 2007
  3. spike
    Replies:
    8
    Views:
    1,506
    Steve Holden
    Feb 9, 2010
  4. Jeff.M
    Replies:
    6
    Views:
    188
    Lasse Reichstein Nielsen
    May 4, 2009
  5. VK
    Replies:
    15
    Views:
    1,239
    Dr J R Stockton
    May 2, 2010
Loading...

Share This Page