#######################################
##这个函数输入金额,返回大写汉字金额##
##bellchiuATNanJingCITIC :em13: ##
#######################################
FUNCTIONF_CONV_GB(pf_money)
DEFINEpf_moneyDECIMAL(14,2)
DEFINEll_money INTEGER
DEFINEi SMALLINT
DEFINEli_bit SMALLINT
DEFINEli_lengthSMALLINT
DEFINEli_len SMALLINT
DEFINEls_money CHAR(20)
DEFINEls_resultCHAR(64)
DEFINEls_arr_num ARRAY[10]OFCHAR(2)
DEFINEls_arr_unit ARRAY[14]OFCHAR(2)
DEFINEls_arr_unit0ARRAY[14]OFCHAR(2)
LETls_arr_num[1]='壹'
LETls_arr_num[2]='贰'
LETls_arr_num[3]='叁'
LETls_arr_num[4]='肆'
LETls_arr_num[5]='伍'
LETls_arr_num[6]='陆'
LETls_arr_num[7]='柒'
LETls_arr_num[8]='捌'
LETls_arr_num[9]='玖'
LETls_arr_num[10]='零'
LET ls_arr_unit[1]='分'
LET ls_arr_unit[2]='角'
LET ls_arr_unit[3]='元'
LET ls_arr_unit[4]='拾'
LET ls_arr_unit[5]='佰'
LET ls_arr_unit[6]='仟'
LET ls_arr_unit[7]='万'
LET ls_arr_unit[8]='拾'
LET ls_arr_unit[9]='佰'
LET ls_arr_unit[10]='仟'
LET ls_arr_unit[11]='亿'
LET ls_arr_unit[12]='拾'
LET ls_arr_unit[13]='佰'
LET ls_arr_unit[14]='仟'
LET ls_arr_unit0[1]='整'
LET ls_arr_unit0[2]='零'
LET ls_arr_unit0[3]='元'
LET ls_arr_unit0[4]='零'
LET ls_arr_unit0[5]='零'
LET ls_arr_unit0[6]='零'
LET ls_arr_unit0[7]='万'
LET ls_arr_unit0[8]='零'
LET ls_arr_unit0[9]='零'
LET ls_arr_unit0[10]='零'
LET ls_arr_unit0[11]='亿'
LET ls_arr_unit0[12]='零'
LET ls_arr_unit0[13]='零'
LET ls_arr_unit0[14]='零'
IF pf_money=0THEN
RETURN'零元整'
ENDIF
IFpf_money<0THEN
LETpf_money=0-pf_money
LETls_result='负'
ELSE
LETls_result=''
ENDIF
IFpf_money>999999999999.99THEN
RETURNls_result='数值超出范围'
ENDIF
LETls_money=pf_money*100USING"<<<<<<<<<<<<<<"
LETli_length=length(ls_moneyCLIPPED)
fori=1toli_length
LETli_bit=ls_money[i]
ifli_bit=0then
LETli_len=length(ls_resultCLIPPED)
ifls_result[li_len-1,li_len]<>'零'then
LETls_result=ls_resultCLIPPED,ls_arr_unit0[li_length-i+1]
else
LETls_result=ls_result[1,li_len-2],
ls_arr_unit0[li_length-i+1]
endif
else
LETls_result=ls_resultCLIPPED,ls_arr_num[li_bit],
ls_arr_unit[li_length-i+1]
endif
ENDFOR
returnls_resultCLIPPED
ENDFUNCTION