Formating the number column

how to format
126.810 as 1268100
23.50 as 0235000
fractional part should be 4 digit and integer should be 3 digit.

You need to multiply by 10000 first and then format using to_char, eg:
with my_tab as (select 126.810 num from dual union all
                select 23.50 num from dual union all
                select 0.02 num from dual)
-- end of mimicking data in a table called my_tab
-- check out the SQL below
select num, to_char(num*10000, '0999999') formatted_num
from   my_tab;
       NUM FORMATTED_NUM
    126.81  1268100    
      23.5  0235000    
       .02  0000200ETA: If you could have larger numbers, then something like:
with my_tab as (select 126.810 num from dual union all
                select 23.50 num from dual union all
                select 123456789.9854 num from dual union all
                select 0.02 num from dual)
-- end of mimicking data in a table called my_tab
-- check out the SQL below
select num, to_char(num*10000, 'fm9999999990999999') formatted_num
from   my_tab;
       NUM FORMATTED_NUM   
    126.81 1268100         
      23.5 0235000         
123456790 1234567899854   
       .02 0000200          Edited by: Boneist on 30-Apr-2010 17:01

Similar Messages

  • How to lpad and format a number column

    Hi,
    I have a requirement to format a number column and then lpad with '*' to 12 characters. For example if the column value is 1234560 then i have to display it as *****1,234,560.00. I tried using <?xdofx:lpad(format-number:AMOUNT;'999G999D99',12,'*')?> and <?xdofx:lpad(to_char(AMOUNT,'999,999,99.99'),12,'*')?>.
    Can any1 suggest me how to lpad and format the value.
    Thanks in advance.

    Hi,
    Use the following syntax for the lpad function, and use the MS word format mask for the formatting part. <?xdofx:lpad(AMOUNT,12,'*')?>

  • How can I format the number in ?shape-text:

    Hi All,
    I am using shapes in the rtf template. I need to format the number which is used in the shape as
    <?shape-text:mytagname?>
    now mytagname has inconsistent values in the xml like 3, 4.5, 3.55. I want to format this to two digits after decimal i.e 0.00 format.
    How can I format the number in <?shape-text: ???
    Regards,
    Amit Deshpande
    Persistent Systems Ltd

    Hi Amit,
    <?shape-text:format-number(4.5,'#,##0.00')?>

  • Cannot format the number

    I have a problem to make the number formatted to 2 points.
    This is the code i use and i expect to get iQ = 0.13 instead of 0.133 using codes below. What is my syntax arror actually?
    Could anybody tell me?
    NumberFormat nf;
    nf = NumberFormat.getInstance();
    nf.setMaximumIntegerDigits(2);
    nf.setMinimumIntegerDigits(2);
    String iQ = nf.format(iQuan);
    System.out.println("iQ :"+iQ);     
    Thanks alot.

    You used setMaximumIntegerDigits and setMinimumIntegerDigits which is for limiting the number of numbers before the ' .' . to limit the number after the '.' you have to use
    setMinimumFractionDigits and setMaximumFractionDigits
    <code>
    NumberFormat nf = NumberFormat.getInstance();
    nf.setMaximumIntegerDigits(1);
    nf.setMinimumIntegerDigits(1);
    nf.setMinimumFractionDigits(1);
    nf.setMaximumFractionDigits(2);
    double iQuan = 0.1333;
    String iQ = nf.format(iQuan);
    System.out.println("iQ :"+iQ);      
    <code>
    Which prints: iQ :0.13

  • Windows Desktop Search 4.0 How do I Format the Date Column in the Results?

    Is there a way to modify the date column in the Results pane of Windows Desktop Search 4.0?
    It's running on a Windows 2003 Enterprise server.
    I have users that need to modify files that arrived today and yesterday after 5:00 PM.  The date column only displays the time on files with today's date.  Is there some registry setting I can tweak to get this column to always show Date and Time?
    Cordially,
    RN

    Hi,
    For the Windows Desktop Search, i think you may ask in:
    http://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/home?forum=windowsdesktopsearchhelp
    Regards.
    Vivian Wang

  • Format the total value in the column of the graph table

    Hello all,
    I have a graph table and I need to format the total value in the column of the table.
    I am trying to find my table bean with the code below but it's not working in the processRequest. Is there anything else that should be done?
    // Get the graph
    OAGraphTableBean graphBean = (OAGraphTableBean)webBean.findChildRecursive("MyGraph");
    // Get the table
    OATableBean tblBean = (OATableBean)graphBean.findChildRecursive("MyTable");
    The tblBean is null in the processRequest. In the processFormRequest the tblBean is not null.
    Thanks and Regards,
    Andrea

    Hi,
    The code OAGraphTableBean graphBean = (OAGraphTableBean)webBean.findChildRecursive("MyTable"); does not work because in this case I am getting the table but casting to a graph.
    The MyTable bean is a child of MyGraph.
    When creating a graph bean we have the option to create a table as a child (select your graphTable region in the Structure pane, and choose New > tabularFormat - to create the table).
    The table bean child I can get just in the processFormRequest, but the graph I can get in both processRequest and processFormRequest.
    I need to get the table bean in the processRequest to format the total value column.
    Do you know if is there anything else that should be done to format the total column?
    Thanks and Regards,
    Andrea

  • In XML Output the values of Number column tags are not displayed properly

    Hi,
    Our Client have been using AR Invoice Print Program for a long time and it is heavily customized. Also they are using an old version of the RDF. So we have taken the latest version of the RDF (RAXINV.rdf) for Oracle Apps 11.5.10.2 by raising a SR and implement Client's old RAXINV.rdf into it.
    All was ok, but when we are running the program, the XML Output did not generate properly. For the Q_INVOICE query (G_ORDER_BY, G_INVOICE and G_INV_TERM group), the value of some of the scaler number columns are not appeared properly. The tags are coming correctly, but the value is appearing as '*', instead of the correct value. We have checked in the RDF Level (By putting srw.message and check in the log file) that those columns are having proper value. So there is no issue with the RDF.
    But because of the above mentioned problem, the some of the PDF output field values also is not generated correctly.
    I think that because of the lexical parameters which was implementing the Q_INVOICE query (&COMMON_QUERY) this issue is coming. Because the issue is only in the Q_INVOICE query group (G_ORDER_BY, G_INVOICE and in G_INV_TERM group) not in any other query group.
    There is no problem with the scaler character columns. The issue is only with the number columns.
    Also we have checked that if we hardcode the value of the number columns in the above mentioned lexical parameter, this problem doesn't appear.
    If we put TO_CHAR function to those number columns in the lexical parameter (COMMON_QUERY), then this issue get solved. But we can't do it because of performance issue and also Client won't approve it.
    Please help.
    With Thanks and Regards

    I don't know how to read the code you pasted or I would have checked this myself.
    Do your fields in the internal table reference dictionary objects or elementary types? If not using dictionary types, the column names will be blank by default. If you can't change your fields to be dictionary types, you can try this to change the column names:
    I made a method inside my local class to add the names:
            call method set_colname
              EXPORTING iv_tab = alv_tab
                        iv_colid = 'xxxx'  "fieldname from the table
                        iv_stxt = text-t54
                        iv_mtxt = text-t55
                        iv_ltxt = text-t55.
    METHOD set_colname .
      data:
              alv_cols type REF TO cl_salv_columns_table,
              alv_col type REF TO cl_salv_column.
      TRY .
    *... Change fieldnames
            call METHOD iv_tab->get_columns RECEIVING value = alv_cols.
            call method alv_cols->get_column EXPORTING columnname = iv_colid RECEIVING value = alv_col.
            IF iv_stxt <> ''.
              CALL METHOD alv_col->set_short_text EXPORTING value = iv_stxt.
            ENDIF.
            IF iv_mtxt <> ''.
              CALL METHOD alv_col->set_medium_text EXPORTING value = iv_mtxt.
            ENDIF.
            IF iv_ltxt <> ''.
              CALL METHOD alv_col->set_long_text EXPORTING value = iv_ltxt.
            ENDIF.
       CATCH cx_salv_not_found.
      ENDTRY.
    ENDMETHOD. "set_colname

  • Formatting a number element with commas and decimals.

    I have a dataset with numbers.  I already set the column type to "number".
    I want to format the number data with commas and decimals.  I found a way to add decimals, but I'm still very confused how to do commas and to combine that with the decimal formatting.
    Also, how do I apply that to a repeat region in my spry region?
    Any help would be appreciated.  Thank you very much.

    I found this on one of the forum questions.
    Excel dont preserve the trailing zeros.
    try opening the xcel and type 5.0000 and tab out, it wont preserve the trailing zeros after decimal.
    try finding out how to disable the option in excel. if you do that, you will see what you send out from the report.
    But you can try to convert the number into a text by trying to append a space at the beginning. See if that would work.
    Thanks
    Swarna

  • Sqlplus set statement:format the output without specifying every col length

    Hi ppl,
    i am writing below query inside a shell script. Is there any way to format the output of sqlplus without providing the name of all the columns that we are going to output. for example, in below code i have specified the column width of the columns i want to output. but if the number of columns is large (or when we want to do a select * from...) then it becomes tedious to write all of them. Is there any way i can define display length all the columns to be of same size.. or at least all the number columns of one size, char columns of one size etc...
    sqlplus -sa/passwd@db_name << EOF
    SET ECHO ON;
    SET HEADING ON;
    COLUMN USERNAME FORMAT A20;
    COLUMN USER_ID FORMAT A20;
    COLUMN PASSWORD FORMAT A20;
    spool filename.txt
    some qry... ;
    exit
    EOFThanks
    Edited by: KnockTurnAll on 25 Oct, 2010 10:41 PM
    Edited by: KnockTurnAll on 26-Oct-2010 04:25

    My SQL*Plus is a bit rusty, but I don't think you can for characters. You can set NUMWIDTH for a default size for numeric columns.
    You could write a small bit of SQL to generate the required column definitions. You could even hit ALL_TAB_COLUMNS to generate a generic 'set every column width' file and run it as a separate sql script in your main script. Not sure if there is an upper limit on the number of Columns you can define.
    Back in the day when we did everything with SQL*Plus scripts, we had a standard columns file that we called in all our scripts, just for this purpose.
    Carl

  • Custom Numeric Format - Treat Number as Custom

    Hi,
    I want to be able to format the number results in thousands or even in millions. In excel, the "in thousand" format will be like this:-
    _(* #,##0,;_(* (#,##0,);_(* "-"_);_(@_)
    How do we do it in Answers' column properties > data format?
    Any advise will be appreciated.
    Is there a list of the codes to use in the custom Numeric format?

    Hi,
    fx of Answer's column divide with 1000000 and select number of decimals in column properties -> data format
    for example table_name.amount/1000000
    UPDATED POST
    I think this is the only way...
    If answered assign points and close thread. it would be helpful for the users in the future......
    cheers,
    Aravind
    Edited by: Aravind Addala on May 18, 2011 9:07 PM

  • How to Format a number to support multiple languages

    I am trying to format a number so that it shows up with the corret decimal separators and thousands separators for different regions/languages, but can't seem to.
    123456.223 is 123,456.223 (US English) and 123 456,223 in French (France)
    I don't know how many such regional settings are being used and what the decimal and thousands separators are.
    If you set the Format to 'System Default Number Format', all is well (But I have to live with 2 digits after the decimal). However, if I want to customize it by saying choosing one of the preset formats or using 'Customize'(say 3 digits after the decimal, for example), then, if I am designing the report in US English setting, the separators from that setting are used, even when the report is generated in French locale. Even if I try to put in a condition for these separators and use 'DefaultAttribute', it doesn't seem to help.
    One workaround is to format the number as a string and display the string instead (this time use ToText() function and provide the no. of decimal places needed). But I have aggregations based on this field and they don't work in with string fields.
    Could someone advise me if there is a way to solve this problem? (I'm hoping that there is some way, perhaps an easy one to overcome this problem.) It seems anytime I want to change the default setting, the current values are stored and used irrespective of the reigonal setting.
    Any help is greatly appreciated.
    Thank you,
    Raghu

    Use the default settings and then it should format according to the local PC settings.

  • How to format large number field in XML so that it appears as is in Excel

    Hi
    I need help in formating the number field so that the number displays completely in Excel.
    Ex: 12345678889453 and this appers in Excel as 1.23457E+13
    Please let me know if you have any idea on this.
    Thanks

    Hi friends,
    Thanks to all of you that you all have replied my question and given your answers.
    Thanks to all of you specially Alpana Phapale, Wallie Chang, Poonam Thorat and Raghavendra Gadhamsetty, the answers given by you is the perfect one may be in different ways and only one can be used by me. But your answers were exactly correct.
    Thanks to Asha Lund, your answers is also correct but the result as per my report should be in figures and not in words.
    Whatever it may be but for repling thanks to you too.
    Please be always with me, I am very new to Crystal Report and just learnt by my own as my Boss ordered me to do this and I have to make about 50 reports within 15 days. I think the day will start from today.
    Well friends thanks a lot again for all your effort.

  • RE: (forte-users) Formatting a number

    Thank you. That worked out great.
    ka
    -----Original Message-----
    From: Thompson Ian [mailto:Ian.Thompsonicl.com]
    Sent: Friday, February 18, 2000 9:35 AM
    To: 'Amin, Kamran'; 'Forte User'
    Subject: RE: (forte-users) Formatting a number
    Ka,
    Try using TextFormat in combination with NumericFormat - like this:
    strfmt : TextFormat = new;
    numfmt : NumericFormat = new;
    number : IntegerData = new;
    numberastext : TextData;
    numfmt.Template='L0000000';
    strfmt.Template='A###-####';
    number.SetValue(source = 23456);
    // Format the number into a TextData.
    numberastext=strfmt.FormatText(source = numfmt.FormatNumeric(source =
    number));
    You may have tried this already, but I hope it helps.
    Regards
    Iain
    -----Original Message-----
    From: Amin, Kamran [mailto:kamran.aminframeworkinc.com]
    Sent: 18 February 2000 13:37
    To: 'Forte User'
    Subject: (forte-users) Formatting a number
    I like to format a number as follows:
    L###-#### - Where a number like 23456 would format to L002-3456.
    Is there any way to do this in Forte using the NumericFormat object.
    thanks in advance.
    ka
    For the archives, go to: http://lists.xpedior.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: forte-users-requestlists.xpedior.com

    Thank you. That worked out great.
    ka
    -----Original Message-----
    From: Thompson Ian [mailto:Ian.Thompsonicl.com]
    Sent: Friday, February 18, 2000 9:35 AM
    To: 'Amin, Kamran'; 'Forte User'
    Subject: RE: (forte-users) Formatting a number
    Ka,
    Try using TextFormat in combination with NumericFormat - like this:
    strfmt : TextFormat = new;
    numfmt : NumericFormat = new;
    number : IntegerData = new;
    numberastext : TextData;
    numfmt.Template='L0000000';
    strfmt.Template='A###-####';
    number.SetValue(source = 23456);
    // Format the number into a TextData.
    numberastext=strfmt.FormatText(source = numfmt.FormatNumeric(source =
    number));
    You may have tried this already, but I hope it helps.
    Regards
    Iain
    -----Original Message-----
    From: Amin, Kamran [mailto:kamran.aminframeworkinc.com]
    Sent: 18 February 2000 13:37
    To: 'Forte User'
    Subject: (forte-users) Formatting a number
    I like to format a number as follows:
    L###-#### - Where a number like 23456 would format to L002-3456.
    Is there any way to do this in Forte using the NumericFormat object.
    thanks in advance.
    ka
    For the archives, go to: http://lists.xpedior.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: forte-users-requestlists.xpedior.com

  • Number columns in Pages 5.5

    I am trying to print a table in Pages 5.5 and need to keep the number column that shows up on the left hand side of the page.  Does anyone know how to do this?

    That is just for your information and working out forumals.
    Create a column with the numbers in it. Pages will do series for you.
    Type 1 in the first cell, two in the second to show th pattern then select both and pull down on the centre handle to extend the sequence.
    It also works for Letters, Dates, Days, Months, Years etc.
    Peter

  • Oracle NUMBER column retreived as System.Double instead of System.Decimal

    We've been using the OleDb Managed Provider for some time now, and all oracle NUMBER datatypes have always come back from the db as System.Decimal.
    we recently installed a new database, and now NUMBER comes back as System.Double. The table create scripts are the same for the new db. The client is not the issue as I can point the same web server at the old db and it works fine.
    I've been unable to find any documentation on the subject.

    I have the same problem also. I'm using VC++6.0 and ADO 2.71 to perform queries with an Oracle Client 9.2.0.1. The same query on same table but on different Server version returns different results. With the production server, which is an 8.1.7.4 server, a NUMBER column returns a LONG value, while on the Test server, which is a 9.2.0.5.0 server, the same column returns a DOUBLE value. The problem is that using ADO I don't check data type/size when getting values, but I aspect a LONG value because a created the column with NUMBER specification. Could this be a different default from previous server version when creating the NUMBER column without any SCALE and PRECISION attributes?

Maybe you are looking for

  • How to upload vendor open item data.

    How to upload vendor open item data.

  • No Keyboard in Safari

    I use an online mail like gmail. Recently when I go to reply in Safari I tap and get a gray bar (like I was going to copy something) but no keyboard and therefroe cannot reply. I have tried reloading the firmwave, change user and then reload etc and

  • Bug in Zen Mi

    Ok, to be able to recreate this bug, you'll need to have an artist with at least 2 different albums. (I'm using firmware version 2.00.2) I went to "Random Play All", and when the Zen played a song by Metallica, it got me in the mood to listen to one

  • Iphoto blank in edit

    Hello friends Problem: Library appears intact but when image is selected and Edit is selected, a blank page appears, either a white blank or a black blank. This is true for all but the last import. Action before: There were MANY, perhaps 200+ photos

  • I am using system 10.7.3 and my I photo 9.2.3 keeps crashing upon start up.  Does anyone know how to correct this without losing my photos?

    I am using system 10.7.3 and my I photo 9.2.3 keeps crashing upon start up.  Does anyone know how to correct this without losing my photos?