Solved

how to 3.3 to 3.30

Posted on 1998-06-21
3
215 Views
Last Modified: 2010-05-03
A variable displays 3.3 and I want 3.30 or always 2 decimals
0
Comment
Question by:harryq
3 Comments
 
LVL 5

Accepted Solution

by:
dirtdart earned 30 total points
ID: 1463885
You would have to assign the number to a string and check the length after the decimal to be able to do that.

Dim sTemp As String
Dim iTemp As Integer

sTemp = "3.3"

iTemp = InStr(sTemp, ".")

If Len(sTemp) - iTemp < 2 Then sTemp = sTemp & "0"


0
 

Expert Comment

by:murrayw
ID: 1463886
Dim N as single, NOut as string

NOut = Format$(N, "###,##0.00")

                              Murrayw



0
 

Author Comment

by:harryq
ID: 1463887
Both  samples work.

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…

856 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