FormatNumber using Single precision

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

Who is Participating?
repsteinConnect With a Mentor Commented:

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

earth2dAuthor Commented:
Thank You
earth2dAuthor Commented:
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!

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.