How to print the total in words in oracle reports

There are many available reports in Oracle Apps so you can discuss the requirements related to these reports here.
Post Reply
azeezpasha
Posts: 26
Joined: Fri Nov 10, 2006 3:15 am
Location: India

How to print the total in words in oracle reports

Post by azeezpasha »

Hi,

I am developing a report in D2K i want to print the total in words

so please do the need ful help as soon as possible.

Regards,
Azeez
azeezmsc@gmail.com
smaamirj
Posts: 12
Joined: Thu Nov 16, 2006 8:05 am
Location: Pakistan
Contact:

Post by smaamirj »

run in a schema ,let say HR
create or replace
function spell_number( p_number in number )
return varchar2
as
type myArray is table of varchar2(255);
l_str myArray := myArray( '',
' thousand ', ' million ',
' billion ', ' trillion ',
' quadrillion ', ' quintillion ',
' sextillion ', ' septillion ',
' octillion ', ' nonillion ',
' decillion ', ' undecillion ',
' duodecillion ' );
l_num varchar2(50) default trunc( p_number );
l_return varchar2(4000);
begin
for i in 1 .. l_str.count
loop
exit when l_num is null;
if ( substr(l_num, length(l_num)-2, 3) <> 0 )
then
l_return := to_char(
to_date(
substr(l_num, length(l_num)-2, 3),
'J' ),
'Jsp' ) || l_str(i) || l_return;
end if;
l_num := substr( l_num, 1, length(l_num)-3 );
end loop;
return l_return;
end;
/

and then check this

select spell_number(5367) from dual;

and in report use

return(spell_num(:v_num));
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest