水晶报表公式编辑

StringVar strX := "";
StringVar strY := "";
StringVar strZ := "";
NumberVar z;
strX:=ToText({tblShipLoadingDetail.intBoxFrom});
strY:=ToText({tblShipLoadingDetail.intBoxTo});
Mid(strX,1,Length(strX)-InStr(StrX,".")-1)+"/"+ Mid(strY,1,Length(strY)-InStr(StrY,".")-1)


Left(ToText({tblShipLoadingDetail.intBoxFrom}),length(ToText({tblShipLoadingDetail.intBoxFrom}))-3)  & "/" &  Left(ToText({tblShipLoadingDetail.intBoxTo}),length(ToText({tblShipLoadingDetail.intBoxTo}))-3)

function VBCInt( NumberVar z)
StringVar strX:='';
NumberVar i:=0;
strX:=ToText(z);
i:=InStr(StrX,'.');
if i>0 then
Mid(strX,1,Length(strX)-InStr(StrX,".")-1)
else
strX


一个水晶报表的数字转换成中文大写的公式!

Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=105454

StringVar x;
StringVar xx := "";
NumberVar z;
NumberVar i;
x := ToText({CL_CFKB.FKJE});
x := Left(x,length(x)-5); //这里所减去的数字,是小数点后面的位数加1的值
                          //我这里是存储时保留小数点后4 位,所以只能精确到个位。
x := Replace(x,",","");
z := length(x);


for i := z to 1 step -1 do
(
    select i
    case 8 : if(Mid(x,z-i+1,1)<>"0") then 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) + "亿" else xx := xx + "亿"
    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) + "佰"
    case 4 : if(Mid(x,z-i+1,1)<>"0") then xx := xx + Mid(x,z-i+1,1) + "十"
    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) + "仟"
    case 1 : if(Mid(x,z-i+1,1)<>"0") then xx := xx + Mid(x,z-i+1,1) + "佰"
);
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","玖");
xx + "元整";


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值