水晶報表中小寫變大寫的函數-VB
Function total (ls as number) as string
dim dx_sz as string
dim dx_dw as string
dim str_int as string
dim str_dec as string
dim dx_str as string
dim fu as string
dim a as string
dim b as string
dim c as string
dim d as string
dim b2 as string
dim num_int as number
dim num_dec as number
dim len_int as number
dim i as number
dim a_int as number
dim pp as number
dx_sz="零壹贰叁肆伍陆柒捌玖"
dx_dw="万仟佰拾亿仟佰拾万仟佰拾圆"
if ls=0 then dx_str="零圆整"
if ls<0 then
ls=abs(ls)
fu="负"
else
fu=""
end if
dx_str=CStr (ls)
dx_str=Replace (dx_str,"¥","")
dx_str=replace(dx_str,",","")
if (ls>=0) and (ls<1) then dx_str="0"+dx_str
pp=InStr (dx_str,".")
if pp>0 then
str_int=mid(dx_str,1,instr(dx_str,".")-1)
else
str_int=dx_str
end if
num_int=ToNumber (str_int)
if (ls>0) and (ls<1) then
num_dec = ls*100
else
num_dec=(ls-num_int)*100
end if
str_dec=totext(num_dec)
str_dec=replace(str_dec,"¥","")
len_int=len(str_int)
dx_str=""
for i=1 to len_int
a=mid(str_int,i,1)
a_int=tonumber(a)
b=mid(dx_sz,(a_int+1),1)
c=mid(dx_dw,(13-len_int+i),1)
if dx_str<>"" then
d=mid(dx_str,len(dx_str)-1,1)
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 i
'处理金额小于1的情况
if len(dx_str)<=2 then dx_str=""
if(num_dec<10)and(ls>0) then
a_int=tonumber(str_dec)
b=mid(dx_sz,(a_int+1),1)
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=tonumber(mid(str_dec,1,1))
a=mid(dx_sz,(a_int+1),1)
a_int=tonumber(mid(str_dec,2,1))
b=mid(dx_sz,(a_int+1),1)
if a<>"零" then a=a+"角"
if b<>"零" then b=b+"分" else b=""
dx_str=dx_str+a+b
end if
dx_str=fu+dx_str
dx_str=replace(dx_str,"零亿","亿")
dx_str=replace(dx_str,"零万","万")
dx_str=replace(dx_str,"零千","千")
dx_str=replace(dx_str,"零圆","圆")
total =dx_str
End Function
水晶報表中小寫變大寫的函數-VB的更多相关文章
- vb.net 水晶報表CrystalReport 動態設定資料庫來源
沒有出現CrystalReportViewer時,須安裝CRforVS_13_0. 新增1個數據集,新增1個數據表,添加二列,列名要和資料庫名一樣. 修改目標Framework 修改app.confi ...
- Grafana展示報表數據的配置(二)
一.Grafana以圖表的形式展示KPI報表的結果數據1.按照日期顯示數據達標量與未達標量2.顯示當前報表的最大值.最小值.平均值.總量3.報表結果數據的鏈接分享與頁面嵌入,用戶無需登錄直接訪問報表統 ...
- [小技巧]設定Reporting Services 2008 發生報表管理員權限不足
转载 http://www.dotblogs.com.tw/dorlis.tsao/archive/2011/01/17/20860.aspx 在自己Windows 7 professional的電腦 ...
- 水晶易表 Xcelsius 2008 安装指南 完美支持office2010(亲手体验)
Xcelsius2008水晶易表是一款很好用的软件.网上已经有破解方法,大家能够尝试一下这款经典软件了. 可是网上对于安装破解过程介绍的不详细或者纷乱,今天我汇总了全部的方法最终成功的安装上了,而且支 ...
- 【转】Xcelsius2008 水晶易表问题 部分汇总
要使用 Xcelsius 2008,需要安装 Adobe Flash 吗? 若要正常运行 Xcelsius 2008,必须安装 Adobe Flash Player 版本 9.如果在安装过程中没有安装 ...
- SqlServer快速获得表总记录数(大数据量)
--第1种 执行全表扫描才能获得行数 SELECT count(*) FROM BUS_tb_UserGradePrice --第2种 执行扫描全表id不为空的,获得行数 select count(u ...
- Oracle臨時表空間過大問題解決
查詢資料庫伺服器時,發現資料庫伺服器磁片使用空間達到了98%,分析總共的資料檔案也不可能達到如此大,經過查詢發現原來臨時表空間的使用方式達到了 32G,導致磁碟空間使用緊張.搜索了相應的文檔與資料後, ...
- 单表千亿电信大数据场景,使用Spark+CarbonData替换Impala案例
[背景介绍] 国内某移动局点使用Impala组件处理电信业务详单,每天处理约100TB左右详单,详单表记录每天大于百亿级别,在使用impala过程中存在以下问题: 详单采用Parquet格式存储,数据 ...
- 用笛卡尔积来创建一千六百万大表 整体19分钟 大表建成两分钟 设置id13分钟
昨天拙文中讲述了用自增方式创建一千六百万大表的方案,这回讨论的是用笛卡儿积,实践证明这种方案更快. 2020年3月15日08点58分实验开始 创建仅有四千数据的tb_4thousand1表: SQL& ...
随机推荐
- Top 10 Mistakes Java Developers Make--reference
This list summarizes the top 10 mistakes that Java developers frequently make. #1. Convert Array to ...
- svn出错错误
RA layer request failed ---------------------------- 解决方案:重启visulsvnserver 若重启不了 出现Service 'VisualSV ...
- Android开发之处理崩溃异常
众所周知,android的设备千差万别,难免会发生崩溃异常等现象,这个时候就需要捕获哪些崩溃异常了,也就是捕获崩溃异常的相关信息,并记录下来,这样一来方便开发人员和测试人员的分析与调试. 1.首先我们 ...
- Spring MVC 3.0.5+Spring 3.0.5+MyBatis3.0.4全注解实例详解(二)
在上一篇文章中我详细的介绍了如何搭建maven环境以及生成一个maven骨架的web项目,那么这章中我将讲述Spring MVC的流程结构,Spring MVC与Struts2的区别,以及例子中的一些 ...
- docker daemonize sshd service
# 第一个-d表示让容器在后台运行 # 末尾的-D表示启动ssh的daemon模式,不然容器启动后立刻就变为停止状态了 docker run -d NAME/VERSION /etc/init.d/s ...
- 基于u盘安装centos6.0
本人在dell笔记本上尝试安装centos6.0,与win7形成双系统,安装过程如下: 1.使用ultraliso制作u盘启动盘,启动盘以centos6.0的映像文件为源头制作: 2.制作完成后,删除 ...
- 【转】企业级Java应用最重要的4个性能指标
应用性能管理(APM)是一种即时监控以实现对应用程序性能管理和故障管理的系统化解决方案.目前主要指对企业的关键业务应用进行监测.优化,最终达到提高企业应用的可靠性和质量,保证用户得到良好的服务,降低I ...
- photoshop 常用快捷键大全
一.文件新建 CTRL+N打开 CTRL+O 打开为 ALT+CTRL+O关闭 CTRL+W保存 CTRL+S 另存为 CTRL+SHIFT+S另存为网页格式 CTRL+ALT+S打印设置 CTRL+ ...
- jsp页面中frameset的使用方法
frame,是网页开发必须掌握的知识.例如后台架构.局部刷新,页面分割,都是frame的用途表现,尤其是后台页面制作,使用frame会给用户带来非常舒适的使用感受. frame知识点包括(frames ...
- Java集合和PHP的对比
这里突然感觉到在java中的集合,和php的数组非常相似 .