Hi all,
I'm trying to make a program generate a random number and then output it. The only problem is, the number needs to be fairly big, so an Integer doesn't work (it creates overflows). I can use a double, but then it outputs a long line of numbers after the decimal point. How can I make it round the number?
Thanks allCode:Private Sub GenRan_Click() Dim RI As Double Dim GN As Double If RanIn.Text = "" Then MsgBox "You must enter a value!", vbExclamation, "Error" Exit Sub End If Randomize RI = RanIn.Text GN = RI * Rnd MsgBox GN, vbInformation, "Your number is..." End Sub![]()




Reply With Quote