如何以美国文化格式显示货币值,如 $5,123,456.55。我知道我可以使用 ToString 方法做到这一点,但不知道怎么做?
最佳答案
这是使用 ToString 方法的解决方案
double cost=5123456.55;
Console.WriteLine(cost.ToString("C", new System.Globalization.CultureInfo("en-US")));
// The example displays the output: $5,123,456.55
关于c# - 以美国文化格式显示货币值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5357387/