Function to convert number to word format.

Dear Friends,
Could you please help me with a code that will take 'sum of all values of a column' as input parameter & return its value in word format.
Number can be negative , it can/can't contain digits after decimal.
i have two ways but it won't work when my no. becomes negative
Moreover i want that it should work on both type of data, numbers without decimal & number with decimal.
that is what i possess:
1)
function CF_1FORMULA return char is
num1 number;
p_number number;
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);
l_return varchar2(4000);
begin
num1:=:my_mumber;
     p_number:=num1;
     l_num:=trunc( p_number );
for i in 1 .. l_str.count
loop
exit when l_num is null;
if ( to_number(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||'Rupees';
end if;
l_num := substr( l_num, 1, length(l_num)-3 );
end loop;
return l_return;
end;
and
2)
select to_char(to_date(floor(1234.99),'J'),'Jsp')||' Rupees and '||to_char(to_date((1234.99-(floor(1234.99)))*100,'J'),'Jsp')||' Paise' from dual;
kindly help me.
Thanks & Regards
Vishnu

Common question.
But you will have realised that already if you'd bothered to search the forum...
http://forums.oracle.com/forums/search.jspa?threadID=&q=number+to+word&objID=f75&dateRange=all&userID=&numResults=30

Similar Messages

  • Converting number in words

    Hi,
    I want to convert number in words and get the output through a query.
    For example :if the value in row is 1311 then I want the query to return it like one thousand three hundreds and eleven.
    Any help is highly appreciated.
    Cheers

    It could be better indeed, scope is larger, but problem with 0 still exists.
    SQL> select to_char(to_date(0,'J'), 'JSP') as converted_form from dual;
    select to_char(to_date(0,'J'), 'JSP') as converted_form from dual
    ERROR at line 1:
    ORA-01854: julian date must be between 1 and 5373484
    SQL> Better to build function as showed by Tom Kyte in the link given earlier.
    Nicolas.

  • Change  a number into  word format in Smartforms.

    hi....
    plz tell me how can I  display word format of a number in a smartforms.
    i have a prientout form which display the net value Rs 3250 .my task to write in word like 'three thausands two hundred fifty rupies only'

    spell_amount FM
    Check this..
    DATA : money TYPE p DECIMALS 2,
    in_letters LIKE spell.
    money = '1000.00'.
    CALL FUNCTION 'SPELL_AMOUNT'
    EXPORTING
    amount = money
    IMPORTING
    in_words = in_letters
    EXCEPTIONS
    not_found = 1
    too_large = 2
    OTHERS = 3.
    WRITE : / in_letters-WORD.
    Madhavi

  • Convert number to words - eg: 1 should come as "first"

    Hi,
    Is there any function module which would convert numbers to words in a particular format.
    for eg: if input is 2, output should be "second".
              if input is twenty, output should be "twentieth".
              and likewise...
    Thanks in advance,
    Vishnu

    Hi,
    Check this program.
    DATA : gv_words TYPE spell.
    DATA : n    TYPE i.
    DATA : BEGIN OF itab OCCURS 0,
            split(100),
           END OF itab.
    PARAMETERS : a TYPE i.
    CALL FUNCTION 'SPELL_AMOUNT'
      EXPORTING
        amount   = a
      IMPORTING
        in_words = gv_words.
    WRITE: gv_words-word.
    SPLIT gv_words-word AT space INTO TABLE itab.
    DESCRIBE TABLE itab LINES n.
    READ TABLE itab INDEX n.
    PERFORM change_num.
    CLEAR: gv_words.
    LOOP AT itab.
      IF sy-tabix EQ 1.
        CONCATENATE gv_words-word itab-split INTO gv_words-word.
      ELSE.
        CONCATENATE gv_words-word itab-split INTO gv_words-word
                                      SEPARATED BY space.
      ENDIF.
    ENDLOOP.
    WRITE: gv_words-word.
    *&      Form  change_num
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM change_num .
      IF itab-split CS 'ONE'.
        REPLACE 'ONE' IN itab-split WITH 'FIRST'.
        MODIFY itab INDEX n.
      ELSEIF itab-split CS 'TWO'.
        REPLACE 'TWO' IN itab-split WITH 'SECOND'.
        MODIFY itab INDEX n.
      ELSEIF itab-split CS 'THREE'.
        REPLACE 'THREE' IN itab-split WITH 'THIRD'.
        MODIFY itab INDEX n.
      ELSEIF itab-split CS 'FOUR'.
        REPLACE 'FOUR' IN itab-split WITH 'FOURTH'.
        MODIFY itab INDEX n.
      ELSEIF itab-split CS 'FIVE'.
        REPLACE 'FIVE' IN itab-split WITH 'FIFTH'.
        MODIFY itab INDEX n.
      ELSEIF itab-split CS 'SIX'.
        REPLACE 'SIX' IN itab-split WITH 'SIXTH'.
        MODIFY itab INDEX n.
      ELSEIF itab-split CS 'SEVEN'.
        REPLACE 'SEVEN' IN itab-split WITH 'SEVENTH'.
        MODIFY itab INDEX n.
      ELSEIF itab-split CS 'EIGHT'.
        REPLACE 'EIGHT' IN itab-split WITH 'EIGHTH'.
        MODIFY itab INDEX n.
      ELSEIF itab-split CS 'NINE'.
        REPLACE 'NINE' IN itab-split WITH 'NINTH'.
        MODIFY itab INDEX n.
      ELSEIF itab-split CS 'TEN'.
        REPLACE 'TEN' IN itab-split WITH 'TENTH'.
        MODIFY itab INDEX n.
      ELSEIF itab-split CS 'ELEVEN'.
        REPLACE 'ELEVEN' IN itab-split WITH 'ELEVENTH'.
        MODIFY itab INDEX n.
      ELSEIF itab-split CS 'TWELVE'.
        REPLACE 'TWELVE' IN itab-split WITH 'TWELFTH'.
        MODIFY itab INDEX n.
      ELSEIF itab-split CS 'TEEN'.
        REPLACE 'TEEN' IN itab-split WITH 'TEENTH'.
        MODIFY itab INDEX n.
      ELSEIF itab-split CS 'TY'.
        REPLACE 'TY' IN itab-split WITH 'TIETH'.
        MODIFY itab INDEX n.
      ELSE. "IF itab-split CS 'D'.
        CONCATENATE itab-split 'TH' INTO itab-split.
        MODIFY itab INDEX n.
      ENDIF.
    ENDFORM.                    " change_num
    Your requirement is definitley solved with above program
    Regards,
    Bhupal

  • Long delay in converting pdf to Word format

    I uploaded a 7.4MB pdf document to convert to Word format nearly 2 hours ago and it is still not complete. Is this normal ? because if it is it is, this package does not do what it is advertised to do. Any ideas. Thank you

    Good day,
    As ExportPDF is a web-based service, you'll be able to access your subscription from any computer that has a modern web browser, an updated version of Flash Player and an internet connection.
    Kind regards,
    David

  • Convert number to words

    is there a way in numbers to convert numbers to words,
    for example"2300" to"two thousand and three hundred".

    Here is a spreadsheet I made to doe this:
    for Numbers 2.x:
    https://www.dropbox.com/s/naooc39djpvn2kk/ValueToText.numbers?dl=0
    for Numbers 3.x:
    https://www.dropbox.com/sh/wz5ejppkbd924mu/AADXJLJ3brHqJL9ts4iq_Kn1a?dl=0
    And a command line application with an Applescript:
    https://www.dropbox.com/s/ajlqxwqbaew5e4m/NumWriterWithScript.zip?dl=0
    See this thread for additional information:
    Return text value of a number

  • Function which converts number 1 to √

    Hello people,
    I recently started Numbers  and I'm in the process of creating a spreadshit to organice various important data concerning my music compositions. I've been trying the following for some days now without any success and I would really apreciate your help!
    What I'm trying to do is to set a cell function so whenever I fill in a cell with the number "1" the actually number to be converted to symbol "√" and fill the cell with a particular color.
    It might be stupidly easy but I have absolutely no knowledge on functions etc etc.
    I have a cell with these characteristics and I know I can simple copy paste the cell to whenever I want but it's a bit more time conciuming and plus I want to learn more on functions
    Thank you very much in advance!

    Jerrold thank you, although to be honest I didn't much understand your solution. I have set a rule that says when "√" highlight with green. There are plenty work-arounds that are the solution to my "problem" but I was just wondering if Numbers was capable of excecuting such a task, and being able to just put the number "1" into a cell and Numbers to transform it to a "√" in a green filled cell - Wayne this is to answer to your question.
    What about the function REPLACE? Might this excecute a simular task? Like replace "1" with "√"?
    Thanks both of you btw for your time and help!

  • Converting Number  into words while Display

    Hello Sir,
    I am working on Project System.
    I am getting Field  MAT_PSPNR(Valuated Sales Order Stock WBS Element) in MSEG Table.
    In table the Corresponding field  stored in Numbers while Display its converted into Some other Content  Please Explain Me ?.
    REPORT  zdemo LINE-SIZE 600.
    tables: mseg.
    select-options: so_mblnr for mseg-mblnr.      " Document No
    start-of-selection.
    select mat_pspnr from mseg into mseg-mat_pspnr    " Valuated Sales Order Stock WBS Element
    where mblnr in so_mblnr.
    check sy-subrc = 0.
    write:/01 mseg-mat_pspnr.
    endselect.
    Table Stored value  for MAT_PSPNR  = 00000293
    Report Display: WSP/RAM/02/03.
    Kindly Explain how the Contents has been changed ?.
    Regards,
    Venkat.

    Hi Venkat,
    please check  the Domain of the field you are trying to display .
    it will have a conversion routine.
    for field MAT_PSPNR domain is PS_POSNR
    In the domain definition tab you will have a conversion routine .
    because of this conversion routine your data is represented in internal format in the table and external format when displayed.
    please read  conversion routine documentation.
    regards,

  • Error in converting number to words

    I use this query
    select (to_char(to_date('46000','J'), 'Jsp'))||' Only'  from dual;It is working fine
    but when I use this query
    select (to_char(to_date('.46','J'), 'Jsp'))||' Only'  from dual;
    showing the error.
    ORA-01858  a non-numeric character was found where a .......

    hoek wrote:
    Hi Solomon,
    Thanks much for commenting and elaborating.
    2. As we all know there is no such thing as year zero.As we all can see, Kame's example is using a string, so I just made up a 'zero' when there's no value present before the decimal sign.Not sure what you mean. I was talking about year 0, not about zero. So to reiterate, you can not use J/JSP format to spell out numbers between 1721058 and 1721423. And since you started talking about 0, your code will not handle 0 as fractional part:
    SQL> with t as ( -- generating some sample data:
      2    select '5.0' str from dual
      3    )
      4    --
      5    --  Actual query:
      6    --
      7    select case
      8             when instr(str,'.') > 0
      9             then nvl(to_char(to_date(to_number(substr(str, 1, instr(str,'.')-1)),'J'), 'Jsp'), 'Zero')||chr(32)
    10             else to_char(to_date(to_number(substr(str, 1, instr(str,'.')-1)),'J'), 'Jsp')
    11           end
    12    ||     case
    13             when instr(str,'.') > 0
    14             then 'point '
    15             else null
    16           end
    17    ||     to_char(to_date(to_number(substr(str, instr(str,'.')+1)),'J'), 'Jsp')
    18    ||     ' Only' str
    19    from   t;
      ||     to_char(to_date(to_number(substr(str, instr(str,'.')+1)),'J'), 'Jsp')
    ERROR at line 17:
    ORA-01854: julian date must be between 1 and 5373484
    SQL> SY.

  • How to convert Number to words In PLD

    Dear Expert,
    I have view all thread related same..but not getting by PLD...
    the amount field i want in Indian format that can be placed on cheque/check ?
    also i add an external data on that PLD now question is that in filed properties ->content -> procedure name ?
    can any one say what that procedure name ? and what u gv ?
    also tell me step for PLD
    please dont send me that begin script link..tell me other way because as per me it will not work with PLD and if i am wrong then tell me.....
    Thanks

    hi kevin,
    In Procedure name u need to link .dll file,Dll files can be created using C++ Programming,
    External data is actually field to print secured images like company logo,Higher official signatures which
    can be tampered when u saved it on computer.
    Hope it clarifies.
    Jeyakanthan

  • NUMBER TO WORDS CONVERSION

    AOA ALL
    Dear i want to convert a numeric value for eg:'1000' into words that is 'ONE THOUSAND' in a report.does any body knows a method or function for that available in developer or any other way...
    do tell me
    thx

    Hi,
    See the link
    converting number to words(100==one hundred)
    Provided a function to convert number to words
    Thanks,
    Oracle Reports Team

  • Number to Word Convert Function

    Dear All,
    Plz anybody have function name which can convert NUMBER to WORD.
    example:  1213 to One Thousand Two Hundred Thirteen
    thanks,
    RP

    rp,
      Pls. use below FM...
    CALL FUNCTION 'SPELL_AMOUNT'
    EXPORTING
    AMOUNT = amouno
    CURRENCY = 'USD'
    FILLER = ' '
    LANGUAGE = SY-LANGU
    IMPORTING
    IN_WORDS = SPELL
    EXCEPTIONS
    NOT_FOUND = 1
    TOO_LARGE = 2
    OTHERS = 3.
    Check
    http://www.sap-img.com/fu001.htm
    (OR)
    Also you can use FM HR_IN_CHG_INR_WRDS.
    report ztest02.
    data: words(50) type c.
    call function 'HR_IN_CHG_INR_WRDS'
    exporting
    amt_in_num = '100000'
    importing
    amt_in_words = words.
    write:/ words.
    Pls. Reward if useful

  • Can the online PDF converter convert secure PDFs to Word format?

    I have a PDF with copy protection set. Will the online PDF converter still convert it to Word format?

    Amplifying George's reply:
    Will Adobe ExportPDF convert any type of PDF file?
    Adobe ExportPDF will convert the vast majority of PDF files available today, including PDF files containing scanned documents.
    There are a few types of PDF files that cannot be converted, however.
    These include, but are not limited to,
    PDF Portfolios,
    PDF files that require a password to open the document, or
    PDF files that have permissions applied to prevent copying, or altering of the content.
    ExportPDF is also not capable of converting hand-written documents to Microsoft Office, due to the non-standard nature of each individual's handwriting.
    http://forums.adobe.com/docs/DOC-1515 
    Be well...

  • I TRY TO CONVERT A PDF FILE TO WORD FORMAT FOR EDITING, WHICH I HAVE PAID, IT SAYS SUBSCRIBE NOW WHY

    WHEN I TRY TO CONVERT PDF TO WORD FORMAT OR TO EXCEL UP POPS A BLOODY SIGN
    ASKING TO SUSCRIBE NOW, I HAVE ALREADY DESCRIBED AND PAID MY MONEY WHAT THE HELL ARE ADOBE
    PLAYING AT HERE, TIME ADOBE GOT THIS SORTED SO THAT I AND OTHERS CAN START DOING WHAT WE
    ARE TRYING TO DO,
    STOP WAISTING OUR TIME ADOBE SUPPORT TEAM, GET THIS FIXED A.S.A.P. I AM NOT A BLOODY HAPPY BUNNY.
    DATA2410

    Hi Paul,
    Welcome!
    I'd like to help!
    What type of document was it prior to becoming a PDF? Is it a scanned document? Perhaps a secure document?
    Please provide more detail so we can troubleshoot together.
    Also - here is a 'getting started' guide that may assist.
    Looking forward to hearing back from you!
    Kind regards, Stacy

  • Convert Smartform to WORD by OLE

    I developed a quotation form with smartforms and now I'm working hard to convert this form to a WORD document by OLE
    I'm in trouble because it works quite fine in WORD 2000 but it doesn't work with WORD 97. I implemented the method cl_gui_frontend_services=>registry_get_value to get the WORD version from frontend but I can't find out what the diefference is. Macros look similar in both versions.
    Has anybody got an idea what the difference is ?
    Thanks in advance, Ulrike

    Hi Ulrike,
    as an alternative way, you can try CONVERT_TEXT function.
    http://help.sap.com/saphelp_erp2004/helpdata/en/d6/0dba8f494511d182b70000e829fbfe/frameset.htm
    In DOI approach,
    do you succeded in converting TABLES to word format?
    As I know, unfortunately there are limited number of tools in abap for such conversion.
    regards,
    Ahmet Sahan

Maybe you are looking for

  • When I add an opendocument login token, it wipes out my parameter/prompt response in the Redirect URL

    I am having this issue and I wonder if anyone has any pointers? When I send the URL with the single prompt response &lsSPrompt0=1234567 it works fine but I have to login to InfoView. So I created a login token .jsp and that took care of the login for

  • Transition from iDVD 4 to 5

    I'm in the middle of an ongoing project on iDVD 4. If I move up to iDVD 5, will my project make the transition seamlessly? Would I be better off completing the project in iDVD 4? Thanks. Linda

  • Iphoto freezing/quitting

    Over the last few days whenever I open iphoto it gives me the message "Loading Photos" and just sits there for about 5 minutes and then quits, and gives me the error message telling me that it just quit. I was hoping that this was more of a temporary

  • Problem of JTable's column setPreferredWidth.

    Hi All, I have a problem about JTable,I want to set the preferredwidth for every column when the table is first established,but it is always failed. Could someone tell me the root?Thanks! import java.awt.*; import javax.swing.*; public class MixerTes

  • EjbHomeRemove vs ejbRemove

    I need to delete a record from the database using BMP. Would I put the call to the database in the ejbHomeRemove or ejbRemove? If I do not place the logic in the ejbHomeRemove, how would I invoke the ejbRemove. I read a document from the tutorials th