开发者

How to retrieve datas from access Database to Datagridview

I have datas as unitprice with 10 decimal places in access database. I want those decimal places to reduce when it comes t开发者_运维问答o datagridview(round to 2 places). How can i achieve this. Any idea.

Thanks in advance


You could round it when retrieving it, but I would recommend to round only the displayed value (because you might need the original value for some calculus).

So here is how you format the first column to round to 2:

grid.Columns(0).DefaultCellStyle.Format = "D2";

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜