formatting numbers with percent

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • CVAR
    New Member
    • Jun 2016
    • 21

    formatting numbers with percent

    Hi, ok, I got 2 questions, I have a progress bar in access, along with the progress bar there is a percentage display label called lblFramePercent wich shows me the percentage completion, also I d my declared percComplete as single for showing me only entire numbers, but I defined perc complete like this

    Me.lblFrameProg ress.Caption = PercComplete * 100 & "%" & "Completed! "

    Now it shows me 16.00125%, for example...
    I tried.
    percComplete =Format(lblFram ePercent, "%%%.%")

    but it didn't worked out

    1. I wanna format my percentage display to only full integers, no decimal places, like 10%,11%,12%, etc.

    2. Also Im curious to know how will it be if it has only one decimal space displaying, like, 10.1%,10.5%, etc.
  • CVAR
    New Member
    • Jun 2016
    • 21

    #2
    I found the solution!

    1. FormatPercent(P ercComplete, 0) & " " & "Completed" , this will give me:
    (i,e 18% Completed", 19% Completed, etc.

    2. FormatPercent(P ercComplete, 1) & " " & "Completed" , this will give me:
    (i,e 18.0% Completed", 19.2% Completed, etc.

    Comment

    Working...