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.
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
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
I think in my first post I made a typo
this line
LblPctTotal = Format(lblPctTotal, ?Percent?)
should read
LblPctTotal = Format(lblPctTotal, "Percent")
Cheers,
Leo
this line
LblPctTotal = Format(lblPctTotal, ?Percent?)
should read
LblPctTotal = Format(lblPctTotal, "Percent")
Cheers,
Leo
SOLUTION
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
Leo
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