Oracle Reports (MOSC)

MOSC Banner

Amount in words (in million or higher value)

edited Jun 11, 2009 6:52AM in Oracle Reports (MOSC) 1 commentAnswered
 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 ' ||

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center