2010年9月16日 星期四

[Crystal Resport] 大寫數字

Global StringVar Array nums := ["零","壹","貳","參","肆","伍","陸","柒","捌","玖"];Global StringVar Array coco := ["元","拾","佰","仟","萬","拾","佰","仟","億","拾","佰","仟","兆"];local StringVar showMoney := "";

local StringVar Array num := Split (CStr ({command.pay_amt}),'.');

local numberVar moneyLeight := Length (num[1]);

local numberVar ten := 1.00;local numberVar i ;

local numberVar c := moneyLeight;

for i := 1 to moneyLeight do(

numberVar nn := ToNumber (Mid(num[1],i,1));

local StringVar Array ann := Split (CStr (nn),'.');

numberVar anni := Length (ann[1]);

local StringVar Array cll := Split (CStr (i),'.');

numberVar clli := Length (cll[1]);

showMoney := showMoney + nums[nn+1] + coco[c] ; c := c-1;);

'新台幣'+showMoney+'整';

Crystal Resport必須用:=來指定參數, =是判斷左右兩方是否相等

沒有留言:

張貼留言