Solved

FormatNumber using Single precision

Posted on 2000-02-22
3
181 Views
Last Modified: 2010-05-02
I need help with the following

How do I Format a number in the answer box(txtAnswer.Text) with 3 decimal places, No leading zeros and no commas.  I am using this for a calculator and I want to be able to divide 33 into 3 and get 3 decimal places with out zeros.  It should look like this .090

0
Comment
Question by:earth2d
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
repstein earned 50 total points
ID: 2549021
earth2d:

TextAnswer.Text = Format(Val(Number1.Text) / Val(Number2.Text), ".000")

I am assuming you want accuracy to 3 decimal places. 3/33=0.09069 which should display as .091 not .090

Richard
0
 

Author Comment

by:earth2d
ID: 2549112
Thank You
0
 

Author Comment

by:earth2d
ID: 2549115
That did work well with an If statement and I used txtAnswer.Text =  Format(msngAnswer, "0.") for the other opt.Values.  That is what I was looking for.  good Deal!

Dee
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

706 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now