Delphi DBGrid 格式显示值
我需要格式化 DBGrid
中的值,以某种格式显示,例如 '#,##0.00'
。知道该怎么做吗?
问候, 彼得
I need to format values in a DBGrid
to display in a certain format ex '#,##0.00'
. Any idea how to do that?
Regards, Pieter
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用字段的 DisplayFormat 属性进行格式化。
检查这个样本
you can use the DisplayFormat property of the field to format.
check this sample
DataSet 中的每个字段都有两个事件:OnGetText 和 OnSetText。使用所需字段的事件 OnGetText 并使用 Format 函数使用掩码格式化值。
Each Field in your DataSet has two events: OnGetText and OnSetText. Use event OnGetText of desired fields and use Format function to format the value using a mask.