Solved

Rounding

Posted on 2004-04-06
8
193 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.
0
Comment
Question by:glennston
8 Comments
 
LVL 19

Accepted Solution

by:
Shauli earned 100 total points
ID: 10768657
Private Sub Command1_Click()
   MsgBox FormatNumber("120.5264", 2)
End Sub

S
0
 
LVL 18

Expert Comment

by:bobbit31
ID: 10768674
CDbl(Fix(text1.text, 2))
0
 
LVL 19

Expert Comment

by:Shauli
ID: 10768689
Or with your textbox:

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

S

0
 
LVL 4

Expert Comment

by:learning_t0_pr0gram
ID: 10769529
Private Sub Command1_Click()
MsgBox Format(Text1.Text, "0.00")
End Sub

could always do that too =\
0
 
LVL 6

Expert Comment

by:PhilAI
ID: 10800874
Well, give someone the points?
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question