How to format double without fractional part

守給你的承諾、 提交于 2019-12-04 04:58:08

问题


The value am sending is 100233

double value = 100233;
string a = (value.ToString("N", CultureInfo.InvariantCulture));

output 100,233.00 but i want 100,233 i don't want the trailing zeros . Is there any specific way to get it ?


回答1:


you are close

double value = 100233;
string a = (value.ToString("N0", CultureInfo.InvariantCulture));


来源:https://stackoverflow.com/questions/17058182/how-to-format-double-without-fractional-part

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!