String Format Integer With Commas, No Decimal Places and Nothing for 0 Values

自作多情 提交于 2019-12-03 13:45:36

I'm not 100% sure what you're after, but after comparing your two string formats, I think I know what you're after... please let me know if I am mistaken.

Once again, you almost had what I think you want... how about trying this:

StringFormat='{}{0:#,#.}'

Or just

StringFormat='#,#.'  (Just replace the '0' from your example with '#')

These are equivalent. Please note that again, these will both round the number to the nearest integer.

UPDATE >>>

Here are two very useful links to help you with your string.Formats in the future:

Custom Numeric Format Strings

Custom Date and Time Format Strings

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