 




<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Print Numbers in words</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/print-numbers-in-words/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/print-numbers-in-words/</link>
	<description></description>
	<lastBuildDate>Fri, 24 May 2013 15:01:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: jolora</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/print-numbers-in-words/#comment-38158</link>
		<dc:creator>jolora</dc:creator>
		<pubDate>Thu, 29 Dec 2005 10:28:03 +0000</pubDate>
		<guid isPermaLink="false">#comment-38158</guid>
		<description><![CDATA[One more time.... 

Here is a PL/SQL function that returns the integer passed to it as words.  I&#039;ll leave it as an excersize for the stupid, uh, I mean student, to use it to handle decimals and dollors/cents....

  function to_words( i_this_number in number )
  return varchar2
  is

/*
   Written by Joe Begenwald, 2005
   anthony.j.begenwald@everestkc.net
*/

    this_number     varchar2(38) := to_char(i_this_number);
    this_number_len number       := length( this_number );
    working_len     number       := length( this_number );
    working_string  varchar2(3);
    pos             number;

    output_string   varchar2(1000);
    idx             pls_integer := 1;

/*
   the following list goes well past 38 digits.  
   the extra names are there just because I know them!
   nothing past UNDECILLION will ever get used.
*/

    type names_t is table of varchar2(100);
    names names_t := names_t( null
                             ,&#039;thousand&#039;
                             ,&#039;million&#039;
                             ,&#039;billion&#039;
                             ,&#039;trillion&#039;
                             ,&#039;quadrillion&#039;
                             ,&#039;quintillion&#039;
                             ,&#039;sextillion&#039;
                             ,&#039;septillion&#039;
                             ,&#039;octillion&#039;
                             ,&#039;nonillion&#039;
                             ,&#039;decillion&#039;
                             ,&#039;undecillion&#039;
                             ,&#039;duodecillion&#039;
                             ,&#039;tredecillion&#039;
                             ,&#039;quattuordecillion&#039;
                             ,&#039;quindecillion&#039;
                             ,&#039;sexdecillion&#039;
                             ,&#039;septendecillion&#039;
                             ,&#039;octodecillion&#039;
                             ,&#039;novemdecillion&#039;
                             ,&#039;vigintillion&#039; );

  begin
    while working_len &gt; 0
    loop
      if working_len &gt; 2 
      then 
        pos := working_len - 2;
      else
        pos := 1;
      end if;
      working_string := substr( this_number, pos, least(working_len,3) );
      working_len := working_len - length(working_string);

      output_string := lower( to_char( trunc(sysdate) +
                                       to_number(working_string)/86400, &#039;SSSSSSP&#039; ) )
                       &#124;&#124; &#039; &#039; &#124;&#124; names(idx) &#124;&#124; &#039; &#039; &#124;&#124; output_string;
      idx := idx + 1;
    end loop;
    return output_string;
  end to_words;

]]></description>
		<content:encoded><![CDATA[<p>One more time&#8230;. </p>
<p>Here is a PL/SQL function that returns the integer passed to it as words.  I&#8217;ll leave it as an excersize for the stupid, uh, I mean student, to use it to handle decimals and dollors/cents&#8230;.</p>
<p>  function to_words( i_this_number in number )<br />
  return varchar2<br />
  is</p>
<p>/*<br />
   Written by Joe Begenwald, 2005<br />
   <a href="mailto:anthony.j.begenwald@everestkc.net">anthony.j.begenwald@everestkc.net</a><br />
*/</p>
<p>    this_number     varchar2(38) := to_char(i_this_number);<br />
    this_number_len number       := length( this_number );<br />
    working_len     number       := length( this_number );<br />
    working_string  varchar2(3);<br />
    pos             number;</p>
<p>    output_string   varchar2(1000);<br />
    idx             pls_integer := 1;</p>
<p>/*<br />
   the following list goes well past 38 digits.<br />
   the extra names are there just because I know them!<br />
   nothing past UNDECILLION will ever get used.<br />
*/</p>
<p>    type names_t is table of varchar2(100);<br />
    names names_t := names_t( null<br />
                             ,&#8217;thousand&#8217;<br />
                             ,&#8217;million&#8217;<br />
                             ,&#8217;billion&#8217;<br />
                             ,&#8217;trillion&#8217;<br />
                             ,&#8217;quadrillion&#8217;<br />
                             ,&#8217;quintillion&#8217;<br />
                             ,&#8217;sextillion&#8217;<br />
                             ,&#8217;septillion&#8217;<br />
                             ,&#8217;octillion&#8217;<br />
                             ,&#8217;nonillion&#8217;<br />
                             ,&#8217;decillion&#8217;<br />
                             ,&#8217;undecillion&#8217;<br />
                             ,&#8217;duodecillion&#8217;<br />
                             ,&#8217;tredecillion&#8217;<br />
                             ,&#8217;quattuordecillion&#8217;<br />
                             ,&#8217;quindecillion&#8217;<br />
                             ,&#8217;sexdecillion&#8217;<br />
                             ,&#8217;septendecillion&#8217;<br />
                             ,&#8217;octodecillion&#8217;<br />
                             ,&#8217;novemdecillion&#8217;<br />
                             ,&#8217;vigintillion&#8217; );</p>
<p>  begin<br />
    while working_len &gt; 0<br />
    loop<br />
      if working_len &gt; 2<br />
      then<br />
        pos := working_len &#8211; 2;<br />
      else<br />
        pos := 1;<br />
      end if;<br />
      working_string := substr( this_number, pos, least(working_len,3) );<br />
      working_len := working_len &#8211; length(working_string);</p>
<p>      output_string := lower( to_char( trunc(sysdate) +<br />
                                       to_number(working_string)/86400, &#8216;SSSSSSP&#8217; ) )<br />
                       || &#8216; &#8216; || names(idx) || &#8216; &#8216; || output_string;<br />
      idx := idx + 1;<br />
    end loop;<br />
    return output_string;<br />
  end to_words;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nikunj</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/print-numbers-in-words/#comment-38159</link>
		<dc:creator>nikunj</dc:creator>
		<pubDate>Wed, 28 Dec 2005 16:22:11 +0000</pubDate>
		<guid isPermaLink="false">#comment-38159</guid>
		<description><![CDATA[Try this simple select... It will convert atleast between 1 and 5373484.

select decode( sign( &amp;&amp;num ), -1, &#039;Negative &#039;, 0, &#039;Zero&#039;, NULL ) &#124;&#124;
       decode( sign( abs(&amp;num) ), +1, to_char( to_date( abs(&amp;num),&#039;J&#039;),&#039;Jsp&#039;) ) &#124;&#124; &#039; Dollars Only&#039;
from dual
/

Enjoy.

Nikunj
]]></description>
		<content:encoded><![CDATA[<p>Try this simple select&#8230; It will convert atleast between 1 and 5373484.</p>
<p>select decode( sign( &amp;&amp;num ), -1, &#8216;Negative &#8216;, 0, &#8216;Zero&#8217;, NULL ) ||<br />
       decode( sign( abs(&amp;num) ), +1, to_char( to_date( abs(&amp;num),&#8217;J'),&#8217;Jsp&#8217;) ) || &#8216; Dollars Only&#8217;<br />
from dual<br />
/</p>
<p>Enjoy.</p>
<p>Nikunj</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: donkennedy</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/print-numbers-in-words/#comment-38160</link>
		<dc:creator>donkennedy</dc:creator>
		<pubDate>Wed, 28 Dec 2005 14:44:52 +0000</pubDate>
		<guid isPermaLink="false">#comment-38160</guid>
		<description><![CDATA[Gee, I did this about 20 years ago in COBOL and it was not anywhere near that complex?]]></description>
		<content:encoded><![CDATA[<p>Gee, I did this about 20 years ago in COBOL and it was not anywhere near that complex?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sanmails</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/print-numbers-in-words/#comment-38161</link>
		<dc:creator>sanmails</dc:creator>
		<pubDate>Tue, 20 Dec 2005 21:18:58 +0000</pubDate>
		<guid isPermaLink="false">#comment-38161</guid>
		<description><![CDATA[i am aware of this select to_char(to_date(123123,J),JSP) from dual,

But this will not go beyond certain value.

And i have already writtern a function to print numbers in words.

I just want to know whether it is possible to do in in single query. Using decode function something like that.

Anyway thanks for your ideas.

Cheers!]]></description>
		<content:encoded><![CDATA[<p>i am aware of this select to_char(to_date(123123,J),JSP) from dual,</p>
<p>But this will not go beyond certain value.</p>
<p>And i have already writtern a function to print numbers in words.</p>
<p>I just want to know whether it is possible to do in in single query. Using decode function something like that.</p>
<p>Anyway thanks for your ideas.</p>
<p>Cheers!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jolora</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/print-numbers-in-words/#comment-38162</link>
		<dc:creator>jolora</dc:creator>
		<pubDate>Mon, 19 Dec 2005 18:52:56 +0000</pubDate>
		<guid isPermaLink="false">#comment-38162</guid>
		<description><![CDATA[As others have said, create a function and  call it in your SELECT statement.

For example, if you create a function called TO_WORDS, you can use

  SELECT COL1, COL3, TO_WORD(CAL5), ...

Here is a fast and comprehensive function for you:

----------------------------------------------------
declare

  t varchar2(1000 );

  function to_words( i_this_number in number )
  return varchar2
  is

/*
   Written by Joe Begenwald, 2005
   anthony.j.begenwald@everestkc.net
*/

    this_number     varchar2(38) := to_char(i_this_number);
    this_number_len number       := length( this_number );
    working_len     number       := length( this_number );
    working_string  varchar2(3);
    pos             number;

    output_string   varchar2(1000);
    idx             pls_integer := 1;

/*
   the following list goes well past 38 digits.  
   the extra names are there just because I know them!
   nothing past UNDECILLION will ever get used.
*/

    type names_t is table of varchar2(100);
    names names_t := names_t( null
                             ,&#039;thousand&#039;
                             ,&#039;million&#039;
                             ,&#039;billion&#039;
                             ,&#039;trillion&#039;
                             ,&#039;quadrillion&#039;
                             ,&#039;quintillion&#039;
                             ,&#039;sextillion&#039;
                             ,&#039;septillion&#039;
                             ,&#039;octillion&#039;
                             ,&#039;nonillion&#039;
                             ,&#039;decillion&#039;
                             ,&#039;undecillion&#039;
                             ,&#039;duodecillion&#039;
                             ,&#039;tredecillion&#039;
                             ,&#039;quattuordecillion&#039;
                             ,&#039;quindecillion&#039;
                             ,&#039;sexdecillion&#039;
                             ,&#039;septendecillion&#039;
                             ,&#039;octodecillion&#039;
                             ,&#039;novemdecillion&#039;
                             ,&#039;vigintillion&#039; );

  begin

    while working_len &gt; 0
    loop
      if working_len &gt; 2 
      then 
        pos := working_len - 2;
      else
        pos := 1;
      end if;

      working_string := substr( this_number, pos, least(working_len,3) );
      working_len := working_len - length(working_string);

      output_string := lower( to_char( trunc(sysdate) +
                                       to_number(working_string)/86400, &#039;SSSSSSP&#039; ) )
                       &#124;&#124; &#039; &#039; &#124;&#124; names(idx) &#124;&#124; &#039; &#039; &#124;&#124; output_string;

      idx := idx + 1;

    end loop;

    return output_string;

  end to_words;

begin

  dbms_output.put_line( &#039;-&#039; );
  dbms_output.put_line( to_words( 1 ) );
  dbms_output.put_line( &#039;-&#039; );
  dbms_output.put_line( to_words( 12 ) );
  dbms_output.put_line( &#039;-&#039; );
  dbms_output.put_line( to_words( 123 ) );
  dbms_output.put_line( &#039;-&#039; );
  dbms_output.put_line( to_words( 1234 ) );
  dbms_output.put_line( &#039;-&#039; );
  dbms_output.put_line( to_words( 12345 ) );
  dbms_output.put_line( &#039;-&#039; );
  dbms_output.put_line( to_words( 123456 ) );
  dbms_output.put_line( &#039;-&#039; );
  dbms_output.put_line( to_words( 1234567 ) );
  dbms_output.put_line( &#039;-&#039; );
  dbms_output.put_line( to_words( 12345678 ) );
  dbms_output.put_line( &#039;-&#039; );
  dbms_output.put_line( to_words( 123456789 ) );
  dbms_output.put_line( &#039;-&#039; );
  dbms_output.put_line( to_words( 1234567890  ) );
  dbms_output.put_line( &#039;-&#039; );
  dbms_output.put_line( to_words( 12345678901 ) );
  dbms_output.put_line( &#039;-&#039; );
  dbms_output.put_line( to_words( 123456789012 ) );
  dbms_output.put_line( &#039;-&#039; );
  dbms_output.put_line( to_words( 1234567890123 ) );
  dbms_output.put_line( &#039;-&#039; );
  dbms_output.put_line( to_words( 12345678901234  ) );
  dbms_output.put_line( &#039;-&#039; );
  dbms_output.put_line( to_words( 123456789012345 ) );
  dbms_output.put_line( &#039;-&#039; );
  dbms_output.put_line( to_words( 1234567890123456 ) );
  dbms_output.put_line( &#039;-&#039; );
  dbms_output.put_line( to_words( 12345678901234567 ) );
  dbms_output.put_line( &#039;-&#039; );
  dbms_output.put_line( to_words( 123456789012345678 ) );
  dbms_output.put_line( &#039;-&#039; );
  dbms_output.put_line( to_words( 1234567890123456789 ) );
  dbms_output.put_line( &#039;-&#039; );
  dbms_output.put_line( to_words( 12345678901234567890 ) );
  dbms_output.put_line( &#039;-&#039; );
  dbms_output.put_line( to_words( 123456789012345678901 ) );

end;
----------------------------------------------------
]]></description>
		<content:encoded><![CDATA[<p>As others have said, create a function and  call it in your SELECT statement.</p>
<p>For example, if you create a function called TO_WORDS, you can use</p>
<p>  SELECT COL1, COL3, TO_WORD(CAL5), &#8230;</p>
<p>Here is a fast and comprehensive function for you:</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
declare</p>
<p>  t varchar2(1000 );</p>
<p>  function to_words( i_this_number in number )<br />
  return varchar2<br />
  is</p>
<p>/*<br />
   Written by Joe Begenwald, 2005<br />
   <a href="mailto:anthony.j.begenwald@everestkc.net">anthony.j.begenwald@everestkc.net</a><br />
*/</p>
<p>    this_number     varchar2(38) := to_char(i_this_number);<br />
    this_number_len number       := length( this_number );<br />
    working_len     number       := length( this_number );<br />
    working_string  varchar2(3);<br />
    pos             number;</p>
<p>    output_string   varchar2(1000);<br />
    idx             pls_integer := 1;</p>
<p>/*<br />
   the following list goes well past 38 digits.<br />
   the extra names are there just because I know them!<br />
   nothing past UNDECILLION will ever get used.<br />
*/</p>
<p>    type names_t is table of varchar2(100);<br />
    names names_t := names_t( null<br />
                             ,&#8217;thousand&#8217;<br />
                             ,&#8217;million&#8217;<br />
                             ,&#8217;billion&#8217;<br />
                             ,&#8217;trillion&#8217;<br />
                             ,&#8217;quadrillion&#8217;<br />
                             ,&#8217;quintillion&#8217;<br />
                             ,&#8217;sextillion&#8217;<br />
                             ,&#8217;septillion&#8217;<br />
                             ,&#8217;octillion&#8217;<br />
                             ,&#8217;nonillion&#8217;<br />
                             ,&#8217;decillion&#8217;<br />
                             ,&#8217;undecillion&#8217;<br />
                             ,&#8217;duodecillion&#8217;<br />
                             ,&#8217;tredecillion&#8217;<br />
                             ,&#8217;quattuordecillion&#8217;<br />
                             ,&#8217;quindecillion&#8217;<br />
                             ,&#8217;sexdecillion&#8217;<br />
                             ,&#8217;septendecillion&#8217;<br />
                             ,&#8217;octodecillion&#8217;<br />
                             ,&#8217;novemdecillion&#8217;<br />
                             ,&#8217;vigintillion&#8217; );</p>
<p>  begin</p>
<p>    while working_len &gt; 0<br />
    loop<br />
      if working_len &gt; 2<br />
      then<br />
        pos := working_len &#8211; 2;<br />
      else<br />
        pos := 1;<br />
      end if;</p>
<p>      working_string := substr( this_number, pos, least(working_len,3) );<br />
      working_len := working_len &#8211; length(working_string);</p>
<p>      output_string := lower( to_char( trunc(sysdate) +<br />
                                       to_number(working_string)/86400, &#8216;SSSSSSP&#8217; ) )<br />
                       || &#8216; &#8216; || names(idx) || &#8216; &#8216; || output_string;</p>
<p>      idx := idx + 1;</p>
<p>    end loop;</p>
<p>    return output_string;</p>
<p>  end to_words;</p>
<p>begin</p>
<p>  dbms_output.put_line( &#8216;-&#8217; );<br />
  dbms_output.put_line( to_words( 1 ) );<br />
  dbms_output.put_line( &#8216;-&#8217; );<br />
  dbms_output.put_line( to_words( 12 ) );<br />
  dbms_output.put_line( &#8216;-&#8217; );<br />
  dbms_output.put_line( to_words( 123 ) );<br />
  dbms_output.put_line( &#8216;-&#8217; );<br />
  dbms_output.put_line( to_words( 1234 ) );<br />
  dbms_output.put_line( &#8216;-&#8217; );<br />
  dbms_output.put_line( to_words( 12345 ) );<br />
  dbms_output.put_line( &#8216;-&#8217; );<br />
  dbms_output.put_line( to_words( 123456 ) );<br />
  dbms_output.put_line( &#8216;-&#8217; );<br />
  dbms_output.put_line( to_words( 1234567 ) );<br />
  dbms_output.put_line( &#8216;-&#8217; );<br />
  dbms_output.put_line( to_words( 12345678 ) );<br />
  dbms_output.put_line( &#8216;-&#8217; );<br />
  dbms_output.put_line( to_words( 123456789 ) );<br />
  dbms_output.put_line( &#8216;-&#8217; );<br />
  dbms_output.put_line( to_words( 1234567890  ) );<br />
  dbms_output.put_line( &#8216;-&#8217; );<br />
  dbms_output.put_line( to_words( 12345678901 ) );<br />
  dbms_output.put_line( &#8216;-&#8217; );<br />
  dbms_output.put_line( to_words( 123456789012 ) );<br />
  dbms_output.put_line( &#8216;-&#8217; );<br />
  dbms_output.put_line( to_words( 1234567890123 ) );<br />
  dbms_output.put_line( &#8216;-&#8217; );<br />
  dbms_output.put_line( to_words( 12345678901234  ) );<br />
  dbms_output.put_line( &#8216;-&#8217; );<br />
  dbms_output.put_line( to_words( 123456789012345 ) );<br />
  dbms_output.put_line( &#8216;-&#8217; );<br />
  dbms_output.put_line( to_words( 1234567890123456 ) );<br />
  dbms_output.put_line( &#8216;-&#8217; );<br />
  dbms_output.put_line( to_words( 12345678901234567 ) );<br />
  dbms_output.put_line( &#8216;-&#8217; );<br />
  dbms_output.put_line( to_words( 123456789012345678 ) );<br />
  dbms_output.put_line( &#8216;-&#8217; );<br />
  dbms_output.put_line( to_words( 1234567890123456789 ) );<br />
  dbms_output.put_line( &#8216;-&#8217; );<br />
  dbms_output.put_line( to_words( 12345678901234567890 ) );<br />
  dbms_output.put_line( &#8216;-&#8217; );<br />
  dbms_output.put_line( to_words( 123456789012345678901 ) );</p>
<p>end;<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tjones</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/print-numbers-in-words/#comment-38163</link>
		<dc:creator>tjones</dc:creator>
		<pubDate>Mon, 19 Dec 2005 17:08:36 +0000</pubDate>
		<guid isPermaLink="false">#comment-38163</guid>
		<description><![CDATA[Here is what Tom Kyte has to say on the subject:

http://asktom.oracle.com/pls/ask/f?p=4950:8:11004214828373033368::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:1407603857650,

]]></description>
		<content:encoded><![CDATA[<p>Here is what Tom Kyte has to say on the subject:</p>
<p><a href="http://asktom.oracle.com/pls/ask/f?p=4950:8:11004214828373033368" rel="nofollow">http://asktom.oracle.com/pls/ask/f?p=4950:8:11004214828373033368</a>::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:1407603857650,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: srinudev</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/print-numbers-in-words/#comment-38164</link>
		<dc:creator>srinudev</dc:creator>
		<pubDate>Mon, 19 Dec 2005 07:42:59 +0000</pubDate>
		<guid isPermaLink="false">#comment-38164</guid>
		<description><![CDATA[Check this...

SQL&gt;select to_char(to_date(112004,&#039;J&#039;), &#039;JSP&#039;) from dual;

SQL&gt;ONE HUNDRED TWELVE THOUSAND FOUR

Regards
Srinivas.V

]]></description>
		<content:encoded><![CDATA[<p>Check this&#8230;</p>
<p>SQL&gt;select to_char(to_date(112004,&#8217;J'), &#8216;JSP&#8217;) from dual;</p>
<p>SQL&gt;ONE HUNDRED TWELVE THOUSAND FOUR</p>
<p>Regards<br />
Srinivas.V</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 3/10 queries in 0.039 seconds using memcached
Object Caching 351/357 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-24 15:29:31 -->