Results 1 to 4 of 4

Thread: Comparison application

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2002
    Location
    Michigan
    Posts
    2

    Angry Comparison application

    What am I doing wrong. The user enters populations and clicks calculate. Well, this works for small numbers, but not large numbers; whY?
    Private Sub Command1_Click()
    If Val(Text4.Text) < Val(Text6.Text) Then
    Text5.Text = Format$((Val(Text4.Text) - Val(Text6.Text)) * 0.01, "percent")
    MsgBox ("Increase in Population")
    Else
    Text7.Text = Format$((Val(Text6.Text) - Val(Text4.Text)) * 0.01, "percent")
    MsgBox ("Decrease in Population")
    End If
    Thank you

  2. #2
    Frenzied Member nishantp's Avatar
    Join Date
    Jan 2001
    Location
    Where you least expect me to be
    Posts
    1,375
    How large are we talking? Longs support numbers up to 2.4 billion or something, so unless you're doing the population of the world, you shouldn't need any more than that...
    You just proved that sig advertisements work.

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2002
    Location
    Michigan
    Posts
    2

    How large?

    The beginning population of a city was 8508098, the ending population was 8434712, and the percent decrease was -73386.00%<br>Thanks for looking in on this.
    Thank you

  4. #4
    Frenzied Member nishantp's Avatar
    Join Date
    Jan 2001
    Location
    Where you least expect me to be
    Posts
    1,375
    Err what? How can the percentage of population decrease be in the thousands? Think about it...you must have made an error in your calculations. If you have say 10 people, you only have 10 people to lose, so you can only lose 100%. Its mathematically impossible.
    You just proved that sig advertisements work.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width