源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

ASP字符串转换为整形、双精度型、布尔

  • 时间:2020-01-12 15:36 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:ASP字符串转换为整形、双精度型、布尔
Rem 将字符串转换为整形数据 function toInteger(str,num)         str=trim(str)         if str="" or not isnumeric(str) then               toInteger=num         else               toInteger=clng(str)         end if end function Rem 将字符串转换为双精度型数据 function toDouble(str)        str=trim(str)        if str="" or not isnumeric(str) then               toDouble=0.0       else               toDouble=cdbl(str)       end if end function Rem 将字符串转换为布尔数据 function toBoolean(str)       str=lcase(trim(str))       if str="true" or str="t" then             toBoolean=true      elseif isnumeric(str) then             if clng(str)<>0 then toBoolean=true      else            toBoolean=false     end if end function
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部