We help IT Professionals succeed at work.

Rounding

glennston
glennston asked
on
Medium Priority
221 Views
Last Modified: 2011-10-03
Hello,

Can you please tell me how I can round the numeric contents of a text box to two decimal places?  I presume I would first need to convert the contents of the text box into a double variable...

Thanks in advance for your reply,
Glenn Houston.
Comment
Watch Question

Top Expert 2004
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Commented:
CDbl(Fix(text1.text, 2))
Top Expert 2004

Commented:
Or with your textbox:

Private Sub Command1_Click()
   MsgBox FormatNumber(Text1.Text, 2)
End Sub

S

Private Sub Command1_Click()
MsgBox Format(Text1.Text, "0.00")
End Sub

could always do that too =\

Commented:
Well, give someone the points?
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.