Link to home
Create AccountLog in
Avatar of vlvawter
vlvawter

asked on

Creating a mask for a percentage

I am trying to create a mask in order to show a percentage.  I've tried "99.99%" and variations, but nothing works.  

I have a textbox that is displaying a float from a database.  I don't want it to show 25.1, but 25.1%.  I know I can go in and adjust the textbox.text, but I'd rather just have a mask.  I will having a lot more of these down the road.  
ASKER CERTIFIED SOLUTION
Avatar of Leo Eikelman
Leo Eikelman

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of Leo Eikelman
Leo Eikelman

if u wanted to actually mask it look at this

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon98/html/vbconusingmaskededitcontrol.asp


You would use the .Mask property and specify 0% for percentages


Cheers,

Leo
I think in my first post I made a typo

this line

LblPctTotal = Format(lblPctTotal, ?Percent?)

should read

LblPctTotal = Format(lblPctTotal, "Percent")


Cheers,

Leo
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Both mine and g_johnson's techniques will work, split points.

Leo