动网论坛,站长建站首选,国内使用量最多的论坛软件 动网论坛官方技术讨论区 站长工具 申请属于您自己的免费论坛
首页 | 新闻资讯 | 网站运营 | 网络编程 | 数据库 | 服务器 | 网页设计 | 图像媒体 | 网络应用 | 搜索优化 | 资源下载 | 动网主机 | DVBOX
    本站内  互联网 ASP论坛  ASP.Net论坛  PHP论坛
   数据库 → 阅读文章

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

作者:郁郁小蝎 来源:中国站长学院 
阅读 1650 人次 , 2006-2-15 17:52:00 

   /*转换整整部分*/
  for i = 1 to len_int
      /*a为小写数字字符,b为对应的大写字符,c为对应大写单位,d为当前大写字符串的最后一个汉字*/
     a= mid(str_int,i,1)
     a_int = long(a)
     b = mid(dx_sz,(a_int*2)+1,2)
     c = mid(dx_dw,((13 - len_int +i - 1)*2+1),2)
     if dx_str<>"" then
       d=mid(dx_str,len(dx_str)-1,2)
     else
        d= ""
     end if

     if (b="零") and ((d="零") or (b=b2) or (c="元") or (c="万") or (c="亿")) then  b = ""
     if (a="0") and (c<>"元") and (c<>"万") and (c<>"亿") then c=""
     if ((c="元") or (c="万") or (c="亿")) and (d="零") and (a="0") then
        dx_str = mid(dx_str,1,len(dx_str)-2)
        d=mid(dx_str,len(dx_str)-1,2)
        if ((c="元") and (d="万")) or ((c="万") and (d="亿")) then c = ""
     end if 
      dx_str = dx_str + b+ c
      b2 = b
  next

    /*处理金额小于1的情况*/
    if len(dx_str) <= 2 then dx_str= ""
    /*转换小数部分*/
    if (num_dec<10) and (ls>0) then
      a_int = long(str_dec)
      b = mid(dx_sz,(a_int*2+1),2)
      if num_dec = 0 then dx_str = dx_str + "整"
      if num_dec > 0 then dx_str = dx_str +"零"+b+"分"
    end if
 
    if num_dec >= 10 then
      a_int = long(mid(str_dec,1,1))
      a = mid(dx_sz,(a_int*2+1),2)
      a_int = long(mid(str_dec,2,1))
      b = mid(dx_sz,(a_int*2+1),2)
      if a<>"零" then a = a+"角"
      if b <> "零" then
    b = b+"分"
      else
   b= ""
      end if
      dx_str = dx_str + a + b
    end if
    if ls= 0 then dx_str = "零元整"
    dx_str = fu+dx_str
 
    result = dx_str
  return result

  
 
 收藏本文  打印本文  论坛讨论  关闭窗口
· 上一篇:在pb中用语音读金额(2)
· 下一篇:在pb中用语音读金额(4)
· 数据库正规化和设计技巧
· 使用Oracle实现实时通信
· 循序渐进学习Power Builder 6.0(2-1-2)
· SQL数据操作基础(初级)5
· 怎样才能限制SQL Server只能让指定的机器连接


关于本站 | 联系我们 | 业务合作 | 客户案例 | 诚聘英才 | 广告合作 | 收藏本站
海口动网先锋网络科技有限公司版权所有
Copyright © 2000 - 2006 Cndw.Com
中华人民共和国电信与信息服务业务经营许可证编号 琼 ICP 020077