删除货币的小数

时间:2012-12-11 15:44:55

标签: c# asp.net-mvc string-formatting

  

可能重复:
  How do I format a double to currency rounded to the nearst dollar?

如何从货币中删除小数?

以下是我如何将数字格式化为货币:

string.Format("{0:C}", Amount)

输出为$ 20,000,000.00,但我需要$ 20,000,000

提前致谢

1 个答案:

答案 0 :(得分:27)

指定您想要零小数位:

String.Format("{0:C0}",Amount)
相关问题