-
March 1st, 2010, 08:59 AM
#1
How to declare 1 digit only for visual basic 6.0?
Hi, this is my source code
Const pi = 3.14159265
Dim Answer As Double
Private Sub Command1_Click()
converter = pi / 180
Answer = Cos(Text1.Text * converter)
Text2.Text = Answer
End Sub
I am having an answer of 1.79489651491878E-09
but what can i add on my command to have only 0 as the answer?
-
March 1st, 2010, 09:23 AM
#2
Re: How to declare 1 digit only for visual basic 6.0?
Hmmm... Round, Format, FormatNumber, text1.text = 0, If Answer < 0 Then text1.text = 0...
But it would help if we knew the value in text1.text...
Good Luck
-
March 1st, 2010, 09:46 AM
#3
Re: How to declare 1 digit only for visual basic 6.0?
Originally Posted by vb5prgrmr
Hmmm... Round, Format, FormatNumber, text1.text = 0, If Answer < 0 Then text1.text = 0...
But it would help if we knew the value in text1.text...
Good Luck
hello sir i chose round, very great!! you're the best cheers
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
|