开发者

How can I format a label caption?

Here's what I want to do. I have a caption that chang开发者_JAVA百科es every time someone uses the app. The caption is a number... and now it appears like a regular number 123456 ... I want to add "," every 3 digits and I really don't know how to do it because the number doesn't have the same number of digits every time... (I want it to be 123,456 instead of 123456 or 1,234,567... and so on). Thanks!


I'm assuming you're setting the caption in code, so you can use VBA's format function to do this:

Me.MyLabel.Caption = Format(MyNum, "#,##0")
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜