number of decimals

G

Guest

Hi! I have a userform attached to a macro. when the macro runs the user can
see how much of the process has been made. I show this in percentage form.
However I do not know how to adjust the number of decimals so now it looks
like this: Completion: 11,23652357754356%. Needless to say it does not look
good. Can anyone help me with this please?

Here I calculate the percentage:
.Caption2 = "Process completion: " & CStr((pos / lngListLength)) * 100 & "
% "

and in a class module i set properties:
Property Let Caption2(strCaption As String)
frmProgress.lblMsg2.Caption = strCaption
DoEvents
End Property

please help me! any help appreciated! thanks alot
 
G

Guest

demo'd from the immediate window:

pos = 20
ListLength = 194
? pos/Listlength
0.103092783505155
? format(pos / ListLength,"0.0%")
10.3%
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top