Binding String Format Number Commas & No Decimal Places

℡╲_俬逩灬. 提交于 2019-12-10 17:54:17

问题


Okay this is an easy one but I'd hugely appreciate your help because I've been mucking around for an hour trying to get it to work.

How do I change the following to get rid of the decimal places and just show the whole number?

Binding="{Binding ANLA, StringFormat=n}"

I know the format is something like

{0:0,0}

But I can't get the backslashes to work.

Thanks hugely in advance!


回答1:


You almost had it... how about trying this:

{Binding ANLA, StringFormat='0,0.'}

Please note that this will round the number to the nearest integer.



来源:https://stackoverflow.com/questions/18759229/binding-string-format-number-commas-no-decimal-places

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