decimal i; var s=decimal.TryParse(test,out i); 测试test的类型,如果是decimal类型,则返回TRUE,否则返回false,将返回结果赋值给s,i会设置为类型转换后的decimal类型值