绑定字符串格式编号逗号无小数位 [英] Binding String Format Number Commas & No Decimal Places

查看:99
本文介绍了绑定字符串格式编号逗号无小数位的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,这很简单,但是我非常感谢您的帮助,因为我一直在努力工作一个小时,以使其能够正常工作.

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}"

我知道格式类似于

{0:0,0}

但是我无法使用反斜杠.

But I can't get the backslashes to work.

非常感谢!

推荐答案

几乎都拥有...如何尝试:

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.

这篇关于绑定字符串格式编号逗号无小数位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆