|
-
Jun 18th, 2000, 08:21 AM
#1
Thread Starter
Lively Member
Hi there,
I have 3 textboxes and a command button. When the button is clicked, the result of text2 divided by text1 appears in text3.
Decimals are not allowed - has to be fractions or whole numbers. I've got it working pretty well:
Private Sub Command1_Click()
If Text1 Mod Text2 > 0 Then
Text3 = Text1 & "/" & Text2
Else:
Text3 = Text1 / Text2
End If
End Sub
However, how can I have it so that the answer is simplified? For example, 12 in text1 and 8 in text2 will give 12/8 in text3, but it would be so much better if it simplified it automatically to 3/2.
Any ideas?
Thanks for any help
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
|