开发者

How can I format a databound textbox as a percentage?

In the properties of my textBox, under DataBinding, I can pull up a dialog to set up all kinds of advanced databinding formatting.

I can set there format for numeric currency, dateTime etc but how can I set for percent?

I mean if I have value 1 I would like to present 100 % if 0,5 then 50 % and s开发者_开发知识库o on


Just use P followed by an optional digit as the format string.

Eg: Console.WriteLine("{0:P2}", 0.6125) will print 61.25%.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜