Number to Character

Dear Friends
I want to convert Numeric Amount to Character Amount in Million
for ex
amount : 5844749.40
Character : Five Million Eight Hundred Fourty four Thousand Seven Hundred Fourty Nige Naira and Fourty Kobo Only
sandy

created a function , but it has shown compilation error.
and how i should call this in report
presently i am taking a program which i had created by just giving
return trranfer(value)
Transfer function
CREATE OR REPLACE FUNCTION Transfer(convnum NUMBER) RETURN VARCHAR2 IS
totstring VARCHAR2(400);
xno NUMBER(13);
xst VARCHAR2(400);
xlen NUMBER(3);
pos NUMBER(3);
rightchar VARCHAR2(2);
convval NUMBER(12);
xtxt VARCHAR2(13);
xdectxt VARCHAR2(50);
pos2 NUMBER(3);
txtitem4 VARCHAR2(20);
mval NUMBER(3);
tval NUMBER(3);
hval NUMBER(3);
xdecimal VARCHAR2(45);
xdecno NUMBER(7,2);
m NUMBER(3);
t NUMBER(3);
h NUMBER(3);
BEGIN
txtitem4:=TO_CHAR(FLOOR(convnum));
xtxt:=LTRIM(RTRIM(txtitem4));
xst:=' ';
convval:=FLOOR(convnum);
m:=FLOOR(convval/1000000);
convval:=convval-m*1000000;
t:=FLOOR(convval/1000);
convval:=convval-t*1000;
h:=convval;
mval:=m;
tval:=t;
hval:=h;
pos2:=1;
IF mval>0 THEN
IF mval>99 AND mval>0 THEN
rightchar:=SUBSTR(m,pos2,1);
xst:=xst||Xstr(TO_NUMBER(rightchar))||' Hundred ';
mval:=TO_NUMBER(SUBSTR(TO_CHAR(mval),2,2));
pos2:=pos2+1;
END IF;
IF mval<100 AND mval>19 AND mval>0 THEN
rightchar:=TO_NUMBER(SUBSTR(m,pos2,1));
xst:=xst||Xstr(TO_NUMBER(rightchar)*10);
pos2:=pos2+1;
rightchar:=TO_NUMBER(SUBSTR(m,pos2,1));
xst:=xst||Xstr(TO_NUMBER(rightchar));
END IF;
IF mval<19 AND mval>=1 THEN
rightchar:=mval;
xst:=xst||Xstr(TO_NUMBER(rightchar));
END IF;
xst:=xst||' Million ';
END IF;
pos2:=1;
IF tval>0 THEN
IF tval>99 AND tval>0 THEN
rightchar:=TO_NUMBER(SUBSTR(t,pos2,1));
xst:=xst||Xstr(TO_NUMBER(rightchar))||' Hundred ';
pos2:=pos2+1;
tval:=TO_NUMBER(SUBSTR(TO_CHAR(tval),2,2));
END IF;
IF tval<100 AND tval >19 AND tval>0 THEN
rightchar:=TO_NUMBER(SUBSTR(t,pos2,1));
xst:=xst||Xstr(TO_NUMBER(rightchar)*10);
pos2:=pos2+1;
rightchar:=TO_NUMBER(SUBSTR(t,pos2,1));
xst:=xst||Xstr(TO_NUMBER(rightchar));
END IF;
IF tval<=19 AND tval>=1 THEN
rightchar:=tval;
xst:=xst||Xstr(TO_NUMBER(rightchar));
END IF;
xst:=xst||' Thousand ';
END IF;
pos2:=1;
IF hval>0 THEN
IF hval>99 THEN
rightchar:=TO_NUMBER(SUBSTR(TO_CHAR(hval),pos2,1));
xst:=xst||Xstr(TO_NUMBER(rightchar))||' Hundred ';
-- pos2:=pos2+1;
hval:=hval-TO_NUMBER(SUBSTR(TO_CHAR(hval),1,1))*100;
END IF;
IF hval<100 AND hval>19 THEN
rightchar:=TO_NUMBER(SUBSTR(TO_CHAR(hval),pos2,1));
xst:=xst||Xstr(TO_NUMBER(rightchar)*10);
pos2:=pos2+1;
rightchar:=TO_NUMBER(SUBSTR(TO_CHAR(hval),pos2,1));
xst:=xst||Xstr(TO_NUMBER(rightchar));
END IF;
IF hval<19 AND hval>=1 THEN
rightchar:=hval;
xst:=xst||Xstr(TO_NUMBER(rightchar));
END IF;
xst:=xst||' Naira';
END IF;
pos2:=1;
xdecno:=(CONVNUM-FLOOR(CONVNUM))*100;
xdectxt:=' ';
IF xdecno>0 THEN
h:=SUBSTR(TO_CHAR(xdecno),1,2);
IF xdecno<100 AND xdecno>19 THEN
rightchar:=TO_NUMBER(SUBSTR(h,pos2,1));
xdectxt:=xdectxt||Xstr(TO_NUMBER(rightchar)*10);
pos2:=pos2+1;
rightchar:=TO_NUMBER(SUBSTR(h,pos2,1));
xdectxt:=xdectxt||Xstr(TO_NUMBER(rightchar));
END IF;
IF xdecno<19 AND xdecno>=1 THEN
rightchar:=xdecno;
xdectxt:=xdectxt||Xstr(TO_NUMBER(rightchar));
END IF;
xdectxt:=xdectxt||'Kobo Only';
xst:=xst||xdectxt;
END IF;
RETURN(xst) ;
EXCEPTION WHEN OTHERS THEN
NULL;
END;
xstr function
CREATE OR REPLACE FUNCTION Xstr(rchar NUMBER) RETURN VARCHAR2 IS
rightcharval VARCHAR2(45);
rightchar NUMBER;
BEGIN
rightchar:=rchar;
IF NVL(TO_NUMBER(rightchar),0)= 1 THEN
rightcharval := 'One ';
ELSIF NVL(TO_NUMBER(rightchar),0)= 2 THEN
rightcharval := 'Two ';
ELSIF NVL(TO_NUMBER(rightchar),0)= 3 THEN
rightcharval := 'Three ';
ELSIF NVL(TO_NUMBER(rightchar),0)= 4 THEN
rightcharval := 'Four ';
ELSIF NVL(TO_NUMBER(rightchar),0)= 5 THEN
rightcharval := 'Five ';
ELSIF NVL(TO_NUMBER(rightchar),0)= 6 THEN
rightcharval := 'Six ';
ELSIF NVL(TO_NUMBER(rightchar),0)= 7 THEN
rightcharval := 'Seven ';
ELSIF NVL(TO_NUMBER(rightchar),0)= 8 THEN
rightcharval := 'Eight ';
ELSIF NVL(TO_NUMBER(rightchar),0)= 9 THEN
rightcharval := 'Nine ';
ELSIF NVL(TO_NUMBER(rightchar),0)= 10 THEN
rightcharval := 'Ten ';
ELSIF NVL(TO_NUMBER(rightchar),0)= 11 THEN
rightcharval := 'Eleven ';
ELSIF NVL(TO_NUMBER(rightchar),0)= 12 THEN
rightcharval := 'Twelve ';
ELSIF NVL(TO_NUMBER(rightchar),0)= 13 THEN
rightcharval := 'Thirteen ';
ELSIF NVL(TO_NUMBER(rightchar),0)= 14 THEN
rightcharval := 'Fourteen ';
ELSIF NVL(TO_NUMBER(rightchar),0)= 15 THEN
rightcharval := 'Fifteen ';
ELSIF NVL(TO_NUMBER(rightchar),0)= 16 THEN
rightcharval := 'Sixteen ';
ELSIF NVL(TO_NUMBER(rightchar),0)= 17 THEN
rightcharval := 'Seventeen ';
ELSIF NVL(TO_NUMBER(rightchar),0)= 18 THEN
rightcharval := 'Eighteen ';
ELSIF NVL(TO_NUMBER(rightchar),0)= 19 THEN
rightcharval := 'Ninteen ';
ELSIF NVL(TO_NUMBER(rightchar),0)= 20 THEN
rightcharval := 'Twenty ';
ELSIF NVL(TO_NUMBER(rightchar),0)= 30 THEN
rightcharval := 'Thirty ';
ELSIF NVL(TO_NUMBER(rightchar),0)= 40 THEN
rightcharval := 'Fourty ';
ELSIF NVL(TO_NUMBER(rightchar),0)= 50 THEN
rightcharval := 'Fifty ';
ELSIF NVL(TO_NUMBER(rightchar),0)= 60 THEN
rightcharval := 'Sixty ';
ELSIF NVL(TO_NUMBER(rightchar),0)= 70 THEN
rightcharval := 'Seventy ';
ELSIF NVL(TO_NUMBER(rightchar),0)= 80 THEN
rightcharval := 'Eighty ';
ELSIF NVL(TO_NUMBER(rightchar),0)= 90 THEN
rightcharval := 'Ninety ';
ELSIF NVL(TO_NUMBER(rightchar),0)= 0 THEN
rightcharval := ' ';
END IF;
RETURN(rightcharval);
END;
/

Similar Messages

  • Are there any plans to fix the misinterpretation of the Exchange ActiveSync policy "Minimum number of character sets"  in IOS6?

    We are testing using IOS6 in our Corporate environment and came across a scenario where IOS6 incorrectly interprets the Exchange 2010 ActiveSync policy "Minimum number of character sets" as the number of special characters required rather than the number of character sets required. Is anyone aware of any plans to correct this in future releases? Here is a thread on Microsoft's forums about the issue:
    http://social.technet.microsoft.com/Forums/en-US/exchangesvrmobility/thread/fe05 1d55-24ba-45e4-b054-67861f28422d/

    We have tried Android, Windows Phone7/8 and they all adhere to the "Minimum number of character sets" set in the ActiveSync policy, but IOS does not.
    Require an alphanumeric password   Select this check box to require device passwords to contain both numbers and letters. The default is numbers only.
    Passwords must include this many character sets   To enhance the security of device passwords, you can require passwords to contain characters from multiple character sets. Select a number from 1 to 4. The sets are letters, uppercase letters, numbers, and symbols. For example, if you select 3, passwords must contain characters from three of these sets.
    All other mobile device except IOS 5.x/6.X don't follow this.
    You have to select "Require an alphanumeric password" which is letters and numbers.  But then you can only select 1-4 for the character sets. 
    So we set it at 1, so that would mean you would only need letters and numbers, IOS does not reconize letters, letters uppercase, numbers or symobols as a charator set, it interprets the setting as how symbols you need.
    If you set it at 2, then IOS makes you have "2" symbols in your password.....and so on...
    Make sense?
    It just seems that IOS does not reconize charator sets, it just looks at the number as how many symbols you need in a password.

  • Are there any plans to fix the misinterpretation of the Exchange ActiveSync policy "Minimum number of character sets"  in IOS5?

    We are testing using IOS5 in our Corporate environment and came across a scenario where IOS5 incorrectly interprets the Exchange 2010 ActiveSync policy "Minimum number of character sets" as the number of special characters required rather than the number of character sets required. Is anyone aware of any plans to correct this in future releases? Here is a thread on Microsoft's forums about the issue:
    http://social.technet.microsoft.com/Forums/en-US/exchangesvrmobility/thread/fe05 1d55-24ba-45e4-b054-67861f28422d/

    Thanks for the responses. I did submit this issue as a bug report earlier this morning also but thought I'd post here in the event any Apple insiders saw this and cared to comment. 
    This really is a significant problem in that our testing shows that the way IOS5 interprets this ActiveSync policy in Exchange 2010 does not allow you to enforce a password using just letters and numbers. This is because  the only valid values for this policy are 1-4. The way IOS5 interprets this requires 1-4 special characters in the password, not 1-4 character sets.

  • Limit number of character in a TextArea

    Hi,
    how can I limited the number of character in a jTextArea?
    thanks!

    You have to customize the Document that your text area is using. You can read more about the Document interface here:
    http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/text/Document.html
    And here is a simple example that demonstrates how you can customize a Document to do what you want. The program should compile and run as is. It will display a JTextArea that only allows ten characters.
    import javax.swing.*;
    import javax.swing.text.*;
    public class LimitedTextArea extends JFrame {
        public LimitedTextArea() {
            setDefaultCloseOperation(EXIT_ON_CLOSE);
            JTextArea text = new JTextArea(5, 40);
            // Set the customized Document on the text area. Only allow
            // a maximum of ten characters:
            text.setDocument(new LimitedDocument(10));
            getContentPane().add(new JScrollPane( text ));
            pack();
            setLocationRelativeTo(null);
        public static void main(String[] args) {
            new LimitedTextArea().setVisible(true);
        // Document that only allows a certain number of characters
        class LimitedDocument extends PlainDocument {
            private int maxLength;
            public LimitedDocument(int maxLength) {
                this.maxLength = maxLength;
            // This method is overriden from the super class. It will be called when
            // you are trying to insert text in your text component (by typing
            // or pasting).
            public void insertString(int offs, String str, AttributeSet a) throws BadLocationException {
                int currentLength = getLength();
                if( currentLength >= maxLength ) {
                    // There's not room for more characters. Return.
                    return;
                if( currentLength + str.length() > maxLength ) {
                    // All of the characters we are trying to insert will not fit.
                    // We must trim the string.
                    str = str.substring(0, maxLength - currentLength);
                // Insert the text:
                super.insertString(offs, str, a);
    }

  • Assigning large number if character to a Codepage

    Do  we have a tool / process  which can assign large number of character to a code page, which cannot be done by SAP SPUM4. There are 18 languages and 10 code pages.
    Languages listed below,
    French,English,German,Italian,Spanish,Portuguese,Bulgarian,Japanese,Chinese,Danish,Russian,Dutch,Finnish,Malaysian,Czech,Hungarian,Norwegian,Swedish
    we run SPUM4 in our Development Environment and found 450.000 words without a language associated. This corresponds to 2,5 months of movements from our ERP  productive clients. After applying a dictionary and language patterns provided by SAP, we have now 274.000 words left (and 150.000 duplicates).  I need to find other ways to decrease this number so that I end up with a workable list of words.

    There is no method but assigning them more or less manually or using hints.
    You may check for special characters in languages, e. g. the polish ł will be displayed as ³ when you login in English - although this may also be a different character.
    We had the same "problem" with 8 languages (including more than one Asian language) so it was cumbersome.
    Markus

  • Which method to count the number of character in a string?

    Hi all,
    I want to know which class and method to count the number of character in a string?
    Gary

    http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html

  • Get number of character within a String by number of pixels

    How can i get the number of character within a String
    by a width value...
    for example..
    i have a String = "1234567890abcdefghi.........."
    and when i give the width "10"
    i will get the String "12".
    or the number of charcter..
    or somthingggggggggggggggg
    please help..
    Shay

    i solved this...
    by doing somthing similar..
    i made a for loop on all character
    and evrey time i am get a sub string from the 0 till the loop index..
    and i am chashing the last string
    so when a sub width is greater the the requested width
    i am returning the lst cashed result
    thanks.. all..

  • How to restrict number of character to be entered in an input field??????

    Hi All,
    I am using the tab phtmlb:formLayoutInputField to define an input field. I need to restrict the end user from entering a maximum of 70 characters(can be any character/number) in the textbox.
    I'll explain in another sentence:::: the end user should be able to enter only 70 characters in the textbox and 71st character should not be allowed to enter. Could anyone please suggest as to how I can achieve this?
    Thanks a lot in advance,
    Best Regards,
    Varun

    Hi,
    We can limit the length of an inputfield by mentioning the maxlength properties of an inputfield.
       <htmlb:inputField   id= "get"
    maxlength="6" />
    This restricts the
    Hope this helps you.
    Regards,
    Rajani

  • Query to separate the number and character

    Hi,
    I have the string like '1000xyza' and query should return 1000 only.
    example data:
    source string = '1000xyz'
    output = 1000
    source string = '1000 xyz'
    output = 1000
    I need to use this logic in trigger, and currently I'm checking character by character in for loop to get number and it is taking long time to execute.
    Please suggest better way
    Thanks for help
    Thanks,
    Vijay

    maybe this will somehow help.
    SQL> With virtual_table AS
      2    (Select '1000xyz' str From dual
      3     Union All
      4     Select  '1000 xyz' str From dual)
      5  select vt.str,
      6         trim(translate(vt.str,'1234567890 ',' ')) char_string,
      7         translate(vt.str,translate(vt.str,'1234567890',' '),' ') numbers
      8    from virtual_table vt;
    STR      CHAR_STRING NUMBERS
    1000xyz  xyz         1000
    1000 xyz xyz         1000
    SQL>

  • Concatenation of number and character

    Hi,
    Can anyone give me an advice
    while i am developing an interface which has one number column,
    Into that number column i have to insert the number formated data with concatenation of characters.
    Ex: trunc(123/89) || 'a'|| mod(345,56) || 'b'
    Like the above format i am giving to a number column then i am getting error like
    Error:Java.lang.numberformatExcpetion.
    Thanks in advance,
    Regards.

    Hi ,
    If the datatype is number means you cannot insert a character.
    Make that column datatype as Varchar and try.
    Thanks,
    Ananth

  • Number of character in string

    Hi,
    How to Find number characters in a string.(not length), The string contains characters of english ,japanese & numericals also.
    Iam splitting the string by 2 length through FM 'split_text' and the and how to find the splitted part has japanese character or english character.
    \[removed by moderator\]
    Regards,
    Narasimhulu P
    Edited by: Jan Stallkamp on Jul 11, 2008 10:36 AM

    Hi Narasimhulu,
    There is System field called sy-abcde which conains all the English letters.
    If your string contains only english and Japanees chars,
    You can check with SY-ABCDE like below.
    DATA:
       w_urstring TYPE STRING.
      w_urstring = 'こんにちは。 Konnichiwa'.
      if  w_urstring ca sy-abcde.
        split  w_urstring into  w_urstring1  w_urstring2.
        if sy-subrc eq 0.
         write:
           /  w_urstring1, w_urstring2.
         endif.
    endif.
    hope this solves ur proble.
    Regards, 
    Rama chary.

  • Maximum number of character we can print in a column uing ALV grid display

    Hi frnds,
    My requirment is to print 500 charcter data in a column using ALV grid display.
    Could any body tell me is it possible and the maximum character it can i print in a column using ALV grid dispaly.
    Regards,
    Sandipan

    Hi Sandipan,
    refer notes 857823, 910300 and 959775. All these say there is a limitation of 128 characters.
    857823 - ALV grid: Strings with a maximum of 128 characters
    Symptom
    Entries in cells of the type CHAR or string are truncated after 128
    characters in the SAP GUI.
    also refer,
    ALV Grid Control (cl_gui_alv_grid), function module (Full-screen) Grid
    (Reuse_alv_grid_display, SAPLSLVC_FULLSCREEN), SAPGUI, back end, front end
    Cause and Prerequisites
    The data table that is sent to the front end only allows character values
    with the length 128.
    Solution
    This is the standard system behavior and cannot be changed.

  • Problem in converting number to character

    Hi All,
    In my report there is number field called <?LINE_TOT_AMOUNT?>. In the next line i want to display that amount in words. I tried using
    <?xdofx:to_char(LINE_TOT_AMOUNT)?>
    but the output is same as the <?LINE_TOT_AMOUNT?>. Can any one help in solving this?

    look at TO_CHAR (number)
    if LINE_TOT_AMOUNT is number then to_char(LINE_TOT_AMOUNT) in string
    it's not display that amount in words
    it's only format row
    if you wnat to convert number to words
    plz see Re: Conversion of number to word

  • Number of character problem

    Hi all,
    In a custom OAF page I need to restrict number of characters in a messageinput between 10 and 11 characters. Field is varchar2 in db. At most is ok. But I can not implement at least proprty.
    How can I do that?
    Actually it is a number field I can change type of field to number if neccessary.
    Thanks in advance for your help.

    Thank for reply,
    I can set the max length. I think in controller using OAMessageTextInputBean I have to set a property but I dont know which one?

  • Limit Number of Character Display per Column

    Hello Everyone,
    I am formatting this template. I would like to set a limit for the number of characters that are to be displayed on on a column.
    For example, a column might have 50 characters. and I only want 20 to display. Like the "substr" function.
    Example: a column data is asdfghj12345..and I only want to set for asdfg to be displayed.
    Does anyone know how this can be done?
    Thanks

    Use <?xdofx:substr('myvalue', 1,20)?>
    You can also limit char strings with the word form field option.
    Shreedev

Maybe you are looking for

  • Overdrive files (.ACSM) will not open in ADE, keep getting errors. Have searched for solution..

    I am having issues downloading library books into ADE. I have been using ADE and borrowing library books for about a year, so I am not new to this. I double click the .ACSM file and ADE opens and acts like it's downloading the book, and then I get th

  • Cant open my apps in itunes

    I purchased calengoo for my iphone and ipad and now for macbook. I see them all under itunes on my macbook but cannot access the software/app. How do I open the application?

  • Cursor in required position

    Hi experts, My form is opening in enter query mode what i want is after performing the required action my cursor will go to a perticular item. suppose after executing one enquiry about a empno i want that my cursor will go to join_date item. can you

  • NW2004s SP9 Java Trial - "Could not create mountpoint for SC in ..."

    Hi I have installed the Sneak Preview NW2004s SP9 Java Trial on a W2003 Server Macheine and everything is looking fine. When trying the Tutorial 2: “Development with a Track“ it cames to the point where i have to Import a Development Configuration fr

  • Scan OS X 10.9.4

    Hi, I have juts bought a new Mac (OS X 10.9.4) and now my HP Officejet 6500A will still print, but not scan anymore. I used to use "HP Scan 3" for scanning, but this gives me the following error message now: "HP Scan 3 kann aufgrund eines Problems ni