如何允许数字和小数点? [英] How to allow numbers and decimal points ?

查看:68
本文介绍了如何允许数字和小数点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

if (!int.TryParse(ds.Tables[s].Rows[i][Columncountvalue + 10].ToString().Trim(), out parsedValue))
 {
//statement
}







我使用上面的代码来限制数据表列中的输入字母。现在我想允许数据表中的小数点和数字(100,102.25)

怎么做。



我尝试过:



如何做小数点和数字只允许。




I have used above code for restrict enter letters in data table columns.now i want to allow decimal points and numbers in data table (100, 102.25)
How to do it.

What I have tried:

how to do decimal points and numbers only allowed.

推荐答案

所以...不要将它解析为整数,将其解析为double,float或小数......
So...don't parse it as an integer, parse it as a double, float, or decimal...


这篇关于如何允许数字和小数点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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