Amount in words (in million or higher value)
I'm using Oracle Reports 6i and I'm a newbie with this application. I can not convert amount in words which has higher value e.g. "millions" or "trillions". Could someone help me and check my script. Thanks
function SPELLED_AMOUNTFormula return Char is
cents number;
c_str varchar2(80);
val number;
begin
val := :TOTAL_AMT;
cents := (val mod 1) * 100;
if cents > 0 then --creates string for cents
c_str := ' and ' || TO_CHAR(cents) || '/100 Pesos';
else
c_str := ' Pesos';
end if;
if val < 1000 and val > 1 then
return (initcap(spell(floor(val))) || c_str);
elsif val > 1000 then
return(initcap(spell(floor(val/1000))) || ' Thousand ' ||
function SPELLED_AMOUNTFormula return Char is
cents number;
c_str varchar2(80);
val number;
begin
val := :TOTAL_AMT;
cents := (val mod 1) * 100;
if cents > 0 then --creates string for cents
c_str := ' and ' || TO_CHAR(cents) || '/100 Pesos';
else
c_str := ' Pesos';
end if;
if val < 1000 and val > 1 then
return (initcap(spell(floor(val))) || c_str);
elsif val > 1000 then
return(initcap(spell(floor(val/1000))) || ' Thousand ' ||
0