|
-
May 28th, 2002, 08:54 PM
#1
Thread Starter
New Member
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
-
May 28th, 2002, 09:18 PM
#2
Frenzied Member
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.
-
May 28th, 2002, 09:32 PM
#3
Thread Starter
New Member
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.
-
May 28th, 2002, 09:58 PM
#4
Frenzied Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|