c# - 删除货币中的小数

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

<分区>

Possible Duplicate:
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

提前致谢

最佳答案

指定您需要零位小数:

String.Format("{0:C0}",Amount)

关于c# - 删除货币中的小数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13823380/

相关文章:

asp.net-mvc - WS-FED 身份验证 (ADFS) 和 ASP.NET Identity UserManager

javascript - 表单提交后重置 Html 表单并防止用户回来查看提交的数据

string - Lua string.format 选项

c++ - 是否有适合 boost::uint64_t 的格式化程序与 snprintf 一起使用?

c# - 如何让 LINQ to SQL 使用在运行时被修改的连接字符串?

c# - 检查空格 Regex C#

c# - 你如何检索变量?

javascript - 未捕获的 TypeError : undefined is not a function when ASP. NET 客户端访问服务

c# - 如何将文件中的 "0x1B"替换为空,即删除

python - 如何将 `str.format` 直接用作 `__repr__` ?