Crystal Report金额转成中文大写
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
StringVar x;
StringVar xx := "";
NumberVar z;
NumberVar i;
x := ToText({OPOR.DocTotal});
x := Replace(x,",","");
x := Replace(x,".","");
z := length(x)-2;
for i := z to -1 step -1 do
(
select i
case 10 : if(Mid(x,z-i+1,1)<>"0") then xx := Mid(x,z-i+1,1) + "?"
case 9 : if(Mid(x,z-i+1,1)<>"0") then xx := xx + Mid(x,z-i+1,1) + "?" else xx := xx + "?"
case 8 : if(Mid(x,z-i+1,1)<>"0") then xx := xx + Mid(x,z-i+1,1) + "?"
case 7 : if(Mid(x,z-i+1,1)<>"0") then xx := xx + Mid(x,z-i+1,1) + "?"
case 6 : if(Mid(x,z-i+1,1)<>"0") then xx := xx + Mid(x,z-i+1,1) + "?"
case 5 : if(Mid(x,z-i+1,1)<>"0") then xx := xx + Mid(x,z-i+1,1) + "?" else xx := xx + "?"
case 4 : if(Mid(x,z-i+1,1)<>"0") then xx := xx + Mid(x,z-i+1,1) + "?" else xx := xx + "?"
case 3 : if(Mid(x,z-i+1,1)<>"0") then xx := xx + Mid(x,z-i+1,1) + "?" else xx := xx + "?"
case 2 : if(Mid(x,z-i+1,1)<>"0") then xx := xx + Mid(x,z-i+1,1) + "?" else xx := xx + "?"
case 1 : if(Mid(x,z-i+1,1)<>"0") then xx := xx + Mid(x,z-i+1,1)+"?"
case 0 : if(Mid(x,z-i+1,1)<>"0") then xx := xx + Mid(x,z-i+1,1)+"?"
case -1 : if(Mid(x,z-i+1,1)<>"0") then xx := xx + Mid(x,z-i+1,1) else xx :=xx+"?"
);
xx := Replace(xx,"1","?");
xx := Replace(xx,"2","?");
xx := Replace(xx,"3","?");
xx := Replace(xx,"4","?");
xx := Replace(xx,"5","?");
xx := Replace(xx,"6","?");
xx := Replace(xx,"7","?");
xx := Replace(xx,"8","?");
xx := Replace(xx,"9","?");
if instr(xx,'?')<=0 then
if instr(xx,'?')>0 then
xx:=left(xx,instr(xx,'?')-2)+'?'+right(xx,len(xx)-instr(xx,'?')+2);
if right(xx,1)='?' then
if instr(xx,'?')>0 then
xx :=left(xx,len(xx)-1)+'?'
else
xx :=left(xx,len(xx)-1)+'??'
else
xx :=xx + "?";