pb 怎么把带小数的字符串转化成数值
来源:百度知道 编辑:UC知道 时间:2024/06/05 14:02:27
比如字符型1.02 ,怎么转化成数值型的1.02
用DOUBLE、dec、real等函数。
string ls_num
double ld_num
...
ld_num = double(ls_num)
if ld_num = 0 and ls_num <> "0" then//如果需要加上其它0.0,0.00...
messagebox("Error","Not a number")
end if