-
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
:mad:
-
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...
-
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.
-
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.;)