![c#中将整数转化为字符串](https://i-blog.csdnimg.cn/blog_migrate/55dd0e3932b16571db63d276bb5ed14d.png)
c#中将整数转化为字符串
When building a string for output to a web page, it’s useful to format any currency value in a human-friendly money format. This is extremely easy in C#.
构建用于输出到网页的字符串时,以人类友好的货币格式格式化任何货币值非常有用。 在C#中,这非常容易。
The system format string works like this: {0:C}
系统格式字符串的工作方式如下:{0:C}
For example, the following code example:
例如,以下代码示例:
decimal moneyvalue = 1921.39m; string html = String.Format("Order Total: {0:C}", moneyvalue); Console.WriteLine(html);
decimal moneyvalue = 1921.39m; string html = String.Format(" Order Total: {0:C} ", moneyvalue);