学院首页>网络编程>其它编程>在pb中用语音读金额(2)

在pb中用语音读金额(2)

作者: 来源: 添加时间:2006-5-22 12:16:59
    /*处理小于零情况*/
  if ls<0 then
     ls = ls*(-1)
     fu = "负"
  else
    fu = ""
  end if

    /*取得整数及整数串*/
  dx_str = string(ls)
  if (ls>0) and (ls<1) then dx_str = "0"+dx_str
  pp = pos(dx_str,".")
  if pp>0 then
    str_int = mid(dx_str,1,pos(dx_str,".")-1)
  else
    str_int = dx_str
  end if
  num_int = long(str_int)

    /*取得小数及小数串*/
  if (ls>0) and (ls<1) then
    num_dec = ls * 100
  else
    num_dec = (ls - num_int) * 100
  end if
  str_dec = string(num_dec)
  len_int = len(str_int)
  dx_str = "" 

站内搜索