防止在DataGridView中自动舍入数字 [英] Prevent auto rounding of numbers in DataGridView

查看:92
本文介绍了防止在DataGridView中自动舍入数字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在以编程方式在数据"列中添加数据.在第一个单元格中,该值为1365,但是当我除以该值时,该值为136.5,datagrid显示137.我不知道这是什么错误.请帮忙.
预先感谢.

Hi,
I am programatically adding data in the column "Data". In the first cell the value is 1365 but when i divide that value is becomes 136.5 and datagrid shows 137. I dont know what is wrong. Please help.
Thanks in advance.

推荐答案

您列的数据类型可能设置为int,不能包含小数.将列的数据类型更改为decimal

爱德华
The datatype of your column is probably set to an int, which cannot contain decimals. Change the datatype of your column to a decimal

Eduard


这篇关于防止在DataGridView中自动舍入数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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