function get_upper_currency(vrmb char)
return varchar2
is
rmbwodecimal varchar2(20);
result varchar2(100);
cunumber varchar2(36);
currency varchar2(52);
rmblen number(2);
vrmb1 number;
begin
if vrmb is null then
return('没有金额');
else
vrmb1 := round(vrmb, 2) * 100;
cunumber := '零壹贰叁肆伍陆柒捌玖';
currency := '分角元拾佰仟万拾佰仟亿拾佰仟';
rmbwodecimal := translate(vrmb1, '1234567890. -', '1234567890');
rmblen := length(rmbwodecimal);
for i in 1 .. length(rmbwodecimal)
loop
result := resultsubstr(cunumber,
to_number(substr(rmbwodecimal, i, 1)) + 1,
1)
substr(currency, to_number(rmblen), 1);
rmblen := rmblen - 1;
end loop;
result := '¥' result '整';
return(result);
end if;
end;