DevExpress XtraGrid 格式 - 如何将所有负数括在括号中
我正在使用 DevExpress XtraGrid 来显示数据。我想在括号中显示负数。数字包括正数和负数。
例如:
123.448
-234.887
-35687.98753
87654.98765
等等...
我想将它们格式化如下
123.448
(234.887)
(35,687.98753)
87,654.98765
为了获得上述结果,需要使用什么格式字符串?
I am using DevExpress XtraGrid to show data. I would like to show the negative numbers in parenthesis. Numbers include both positive and negative numbers.
Eg:
123.448
-234.887
-35687.98753
87654.98765
etc...
I want to format them as below
123.448
(234.887)
(35,687.98753)
87,654.98765
What would be the format string that needs to be used, to get the above result?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
请在列编辑器上使用自定义数字掩码:
Please use the custom numeric mask on your column editor:
您始终可以使用 GridView.CustomColumnDisplayText 事件来更改数据的外观。不过使用 Mask 就简洁多了。
You can always use the GridView.CustomColumnDisplayText event to change the way the data looks. Using a Mask is much neater though.
在mvc中是这样完成的,但我不知道在winforms中是如何完成的。
It is done like this in mvc but I don't know how it is done in winforms.