How to display numbers in triangle format

Hi All,
How do I display numbers in the following format;
1
1 2
1 2 3
1 2 3 4
Your help will be more appreciated.
Thank you.

I couldn't resist:
SQL> var N number
SQL> exec :n := 10;
PL/SQL procedure successfully completed.
SQL> -- plane
SQL> select * from (
  2  select lpad(' '||(case when level between :N/2 - (:N * 0.1) and :N/2 + (:N * 0.1)
  3                 then lpad('*',:N*2.5 - level - abs(:N/2-level),'*')
  4      end) --"left wing"
  5      ,50-level, ' ')
  6    || ltrim(sys_connect_by_path(level,' '))
  7    || (case when level between :N/2 - (:N * 0.1) and :N/2 + (:N * 0.1)
  8              then rpad('*',:N*2.5 - level - abs(:N/2-level),'*')
  9      end) -- "right wing"
10    n
11  from dual 
12  connect by level <= :N
13  order by level);
                                                 1
                                                1 2
                                               1 2 3
                          ********************1 2 3 4********************
                         ********************1 2 3 4 5********************
                          ******************1 2 3 4 5 6******************
                                           1 2 3 4 5 6 7
                                          1 2 3 4 5 6 7 8
                                         1 2 3 4 5 6 7 8 9
                                        1 2 3 4 5 6 7 8 9 10
10 rows selected.
SQL> exec :n := 6;
PL/SQL procedure successfully completed.
SQL> r
  1  select * from (
  2  select lpad(' '||(case when level between :N/2 - (:N * 0.1) and :N/2 + (:N * 0.1)
  3                 then lpad('*',:N*2.5 - level - abs(:N/2-level),'*')
  4      end) --"left wing"
  5      ,50-level, ' ')
  6    || ltrim(sys_connect_by_path(level,' '))
  7    || (case when level between :N/2 - (:N * 0.1) and :N/2 + (:N * 0.1)
  8              then rpad('*',:N*2.5 - level - abs(:N/2-level),'*')
  9      end) -- "right wing"
10    n
11  from dual
12  connect by level <= :N
13* order by level)
                                                 1
                                                1 2
                                   ************1 2 3************
                                              1 2 3 4
                                             1 2 3 4 5
                                            1 2 3 4 5 6
6 rows selected.
SQL>

Similar Messages

  • Idoc-xi-file scenario.  how to display file in html format

    I am not sure whether this is a valid question.........but want to confirm as it was asked by somebody
    In idoc-xi-file scenario.......  how to display file in html format ??
    Thanks in advance
    Kumar

    Hi Vijayakumar,
    Thanks for your reply !! You mean to say I got to use XSLT mapping and also .htm and .html extension together to produce the html file ?? or it is sufficient to use any one of them to produce the html file ??
    Regards
    Kumar

  • How to change numbers in a formatted field

    We are using Adobe Output Designer, we have a numeric field that prints out 50% of that numeric field based on the formatting that we put in that field. We want the printed numbers to print as currency. Currently is prints:
    296.9
    671
    117.275
    etc.
    How can we get it to print:
    296.90
    671.00
    117.28
    Thanks!

    go to Format the field
    In the Data field attribute section
    change the picture field to be ZZ,ZZ9.99. This should apply a currency format to your values

  • How to display numbers in LED form

            I am doing  a demo software of HP33120.In this case,I will display the number and unit in LED form according to the real instrument.I don't know how to do it ,please help me.Thanks. 

    Hi,
    The simplest way to do this, is to download the "7 segment font" from the following link.
    Creating your own customized indicator is also an option, but far more time demanding.
    http://digital.ni.com/public.nsf/websearch/5DCD38A1D020155386256DA9007DF506?OpenDocument
    Let me know is this is not what you are looking for.
    Regards
    Meister
    NIDK

  • How to display data of yuv format without converting rgb in OpenGL ES?

    I have being study about OpenGL ES for iOS.
    I wonder that data of YUV format is can display without converting RGB.
    In most, the yuv data have to convert RGB for display. But, converting process is very slow, Then, that is not display smoothly.
    So, I would like to try to dispaly YUV data without convert to RGB.
    Is it possible? If possible, what can I do?
    Please, let me give a advice.

    Hi Morgan,
    I think you have at least two choices:
    1 - Replace the colons with ', ' (comma and space) - sort of reasonable on screen and in an export
    2 - Create a second page that has the same report but uses the "export: csv" template. Create a manual link to this page to replace the standard Export link. When such report pages are requested, they download immediately instead of displaying. You can, therefore, use commas in this one and &lt;br&gt; tags in the on-screen report version
    Andy
    ps - To display tags in a post, use &amp;lt; for &lt; and &amp;gt; for &gt;

  • How to display output only sort format in alv

    Hi Experts,
    I have one problem in alv output display. I'm developing alv report for orders raised during the period.I want to display each order wise value(netwr) and order quatity (kwmeng) . i set 8 radio buttons one radio btn click then i want output ex.in grid display click on sort then each order wise calculate the value and quantity . that particular data to display when click on radio button.
    ex:click on sort in grid display.
    (branch) (order no)     (quantity)   (value)                        (BSTNK)
    AMUM     0000003354     2             10                                    3,271
    AMUM     0000003354     1              10                                    6,542
                                                       (above qty sum 2+1=3)  
    (SUM) =   AMUM       0000003354            3                       20            9,813
    HIP2         0000003362     2           5     17,810
    HIP2             0000003362     1          5     23,075
    (sum) = HIP2          0000003362                 10           40,885
    i display output in alv griddisplay.client asking one rb put in selection screen i want output like above only sum col.
    when i click one radio button output is come like (sum) above.
    Please help me.
    Thanks & Regards,
    Balakrishna Gajula

    hi you need to use sortinfo for your requirement.
    ie see the below code.
    "declare sortinfo at data declaration
    data:   wa_sort     type slis_sortinfo_alv,      "''' add this
                layout      type slis_layout_alv.          "add this
    ""make the below changes in your fieldcat
      wa_fieldcat-tabname   = 'FINAL'.
      wa_fieldcat-seltext_m = 'Td - Rvdt'.
      wa_fieldcat-fieldname = 'QUANTITY'.
      wa_fieldcat-do_sum    = 'X'.          """"""add this to your  *QUANTITY field*
      append wa_fieldcat to it_fieldcat.
      clear wa_fieldcat.
      wa_fieldcat-tabname   = 'FINAL'.
      wa_fieldcat-seltext_m = 'temp''.
      wa_fieldcat-fieldname = 'VALUE'.
      wa_fieldcat-do_sum    = 'X'.             """"""add this to your  *VALUE field*
      append wa_fieldcat to it_fieldcat.
      clear wa_fieldcat.
    """"" you need to add this after workarea of fieldcat
      wa_sort-fieldname =  'BRANCH'.  " Here Branch indicates the fieldname
      wa_sort-subtot    = 'X'.
      append wa_sort to it_sort.
      clear wa_sort.
      wa_sort-fieldname = 'ORDERNO'.
      append wa_sort to it_sort.
      clear wa_sort.
    " in your alv fm add sortinfo
      call function 'REUSE_ALV_GRID_DISPLAY'
        exporting
          i_callback_program = sy-cprog
          is_layout          = layout
          it_fieldcat        = it_fieldcat
          it_sort            = it_sort                   """""""""add this
        tables
          t_outtab           = final                   " your internal table name
        exceptions
          program_error      = 1
          others             = 2.
      if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    This solves your purpose.
    Regards,
    koolspy.

  • ToString display for Diagonal Triangle Matrix?

    Hey..i just wanna know how to display the diagonal triangle in a matrix.
    I just want to display it...not calculate it but just display it using forloops.
    like this:
    [x 0 0]
    [0 y 0]
    [0 0 z]
    from this:
    [x x x]
    [y y y]
    [z z z]
    how do i display it using a 2D array of matrix and save it in a 2D array.
    Can anyone help plz..
    Thanks alot..

    any help?

  • How to display page numbers in report

    hi all,
    i would like to know how to display page numbers in this format " 1 of 5" in the report.
    Any help would be much appreciated.
    thanks
    seema

    Hi,
    Check this too...
    Page No. in ALV output
    If you query is solved, kindly close the thread.
    Regards,
    Anjali
    Message was edited by: Anjali Devi Vishwanathan

  • How To See Numbers In Arabic Instead Of Indian Format

    I want to see numbers in Arabic format not in Indian format when i log on the Arabic Interface .
    I have EBS (12.0.6) installed on Linux centos , I have implement the below Oracle Metalink Note to solve this issue
    How To See Numbers In Arabic Instead Of Indian Format [ID 785243.1]
    I installed all the patched mentioned in the note (Apply forms version 10.1.2.2.0 with the forms patch 7488328 , Apply patch 7207440:R12.TXK.A , Apply patch 7601624 - NEW PROFILE OPTION: FORMS DIGIT SUBSTITUTION)
    These patches add the Profile option (FORMS DIGIT SUBSTITUTION) , but when i try to used it has no effect at all .
    So kindly if you have any idea about this issue please help me.
    Regards
    Fadi Lafi

    Hi,
    These patches add the Profile option (FORMS DIGIT SUBSTITUTION) , but when i try to used it has no effect at all .At what level you have set this profile option?
    So kindly if you have any idea about this issue please help me.Have you bounced the application services after setting this profile option? If not, please do so, login again and see if it works.
    Thanks,
    Hussein

  • How to display Formatted text in adobe form

    In adobe form, I want to display the text which is inputed by formatted text edit in WD ABAP application.
    It is always displayed as plain text like '<p>this is test text.</p>'. I have set the attribute Data Format to XHTML, Field Format to Rich Text for the Text Field in adobe form. But it doesn't work.
    How to display these formatted text?
    Thanks and Best Regards,
    Jun

    Hi Juergen,
    I found Your blog and found it  really interesting... though I was not able to use it: I (like Jun Li is asking, I guess) need to use a dynamic text, containing formatting informations (according the xhtml syntax).
    I tried to pass it to the form by an ABAP-dictionary based interface and by means of the context (in a webdynpro page), but both tries failed.
    Some suggestion will be greatly appreciated.
    Thankyou
    Simone

  • How to display an error message after validation in Formatted Search?

    Hi SBO experts,
    if an error is detected on validation in a Formatted Search, how to display an error message to the user entering the data?
    Thanks & Regards,
    Raghu Iyer

    i created a formatted search query & attached it to the field 'Quantity' at Line Item level in Sales Order screen. just for testing purpose, i eneterd the following code lines in the query validating 'Quantity'
    if $[$38.11.0] > 50
    begin
    select @error = 1
    select @error_message = 'Vendor code cannot begin to X sign.'
    end
    the system throws the error : Internal error (8180) occurred [Message 131-183]
    actually, i need to display an error message to the user if Quantity is not in multiples of the OITM.SalFactor2
    if $[$38.11.0] % (SELECT T0.[SalFactor2] FROM OITM T0 WHERE T0.[ItemCode]  = $[$38.1.0]) > 0
    begin
    select @error = 1
    select @error_message = 'Error in Quantity.'
    end
    but, this expression to get the remainder itself seems to have some error
    $[$38.11.0] % (SELECT T0.[SalFactor2] FROM OITM T0 WHERE T0.[ItemCode]  = $[$38.1.0])
    i guess, % operator is used for modulo (to find the remainder of one number divided by another.) ? am i right ?
    Regards,
    Raghu Iyer

  • How to display Doc file format in the JEditPane?

    At this time , JEditPane supports RTF and HTML file format ,but
    Could anyone tell me how to display DOC file format using JEditPane
    or other JTextComponents?
    Thx a lot!
    Caton

    Hi,
    there is no support for doc files (M$ Word?) in Java. You would have to create your own classes for that eventually subclassing JEditorPane, EditorKit, Document etc. As well you'd need your own reader for the doc format.
    The problem I see with that however is that there is nothing such as thedoc file format. Microsoft just saves anything produced by MS Word into files ending with .doc. But, if there is anything such as a .doc file format, it changes more often than the weather in April.
    Ulrich

  • How to display 'List' of objects in table format

    I am trying to display bunch of records in the table format.
    I have the List of bean object populated with table datas.
    Currently the code is working fine ,if I tend to display one record.I am wondering how to display all the records.
    I know theres a 'Fieldloop'.If thats the one please explain with example.

    iterate the object list using field loop. eg. is given below
    [      <Field name='MatchTable'>
    <Display class='SimpleTable'>
    <Property name='columns'>
    <List>
    <String>title</String>
    </List>
    </Property>
    </Display>
         <FieldLoop for='name' in='userlist'>
    <Field name='username'>
    <Display class='Label'>
    <Property name='labels'>
    <ref>name</ref>
    </Property>
    </Display>
    </Field>
         <FieldLoop>
         </Field>

  • My phone displays numbers instead of contact names for incoming calls and text - how do I fix?

    My phone displays numbers instead of contact names for incoming calls and text - how do I fix?  It used to display the names if there was a contact listed, now it just shows numbers regardless of whether or not the number corresponds to a contact name in the contact list.  Can anyone help?  I googled this problem and lots of folks have experienced it, however there is not a consensus for a resolution.

    Alexandribill, I have been having the exact same issue.  I got a new phone and restored my contacts.  If the # doesn't have the area code first then the name isn't shown.  I just added my husbands area code to my phone and called my phone from his and now his name shows up...Ugh, I have to go through and manually add the area code to all my contacts....
    I'd say Verizon needs to rewrite their program to include the area code in the restoring from backup process!

  • How to display currency values in indian format

    hi all,
       When I am displaying Currency values as output , those are displaying in U.S. format (ie.1,234,000.00) , But I need to display those in Indian Rupee format (i.e 12,34,000.00).
    Plz any one can help me that how to display this
    thank you,
    regards
    Hanuma

    Hi Hanuma kumar, please try this code.
    REPORT ZAMOUNT_CONVERSION.
    DATA : RESULT1(20).
    PARAMETERS : NUM TYPE P DECIMALS 2.
    DATA : num2 type STRING.
    DATA :  col_amt(20) type n,"15
             col_b type i,
             num_1(20) type C,"15
             Length type i.
    num_1 = num.
    write : 'default format      :',num.
    uline.
    skip.
    IF ( num >= 999999999 ).
           write num_1 using edit mask 'RR__,__,__,__,______' to col_amt.
           CONDENSE col_amt.
           length = STRLEN( col_amt ).
           if length = 16.
             REPLACE first OCCURRENCE OF ',' in col_amt with space.
             write :/'amount indian format:',col_amt.
           else.
           write :/'amount indian format:',col_amt.
           endif.
    ELSEIF NUM < 999999999 AND NUM >= 9999999.
           write num_1 using edit mask 'RR__,__,__,______' to col_amt.
           condense col_amt .
           length = STRLEN( COL_AMT ).
           if length = 13.
             REPLACE first OCCURRENCE OF ',' in col_amt with space.
             write :/'amount indian format:',col_amt.
           else.
             write :/'amount indian format:',col_amt.
          endif.
    ELSEIF NUM < 9999999  AND NUM >= 99999.
           write num_1 using edit mask 'RR__,__,______' to col_amt.
           condense col_amt .
           length = STRLEN( COL_AMT ).
           write :/'amount indian format:',col_amt.
    ELSEIF NUM < 99999.
       data : dumy(10) type c.
       dumy = num .
       CONDENSE dumy.
       length = STRLEN( dumy ).
         if length <= 6.
           write :/'amount indian format:',num.
           else.
           write num_1 using edit mask 'RR__,______' to col_amt.
           write :/'amount indian format:',col_amt.
          endif.
       ENDIF.
       uline.

Maybe you are looking for

  • Key Figure Calculation in Query

    Gurus, How do i calcculate below  in query  basically i have 3 KF as dates below and want a CKF or formula variable which calculates A - (IF B Not Empty then take B  or else take C.) Z = A - if (B != " '', B, C) A = Key Figure B = Key Figure C = Key

  • Can't uninstall Adobe Air but Adobe Air doesn't work correctly

    An external agency created a flash-application which should be installed to my computer with Adobe Air. By clicking the .Air-file the installation process of Adobe Air started but the installation of the flash-application failed. At least I uninstall

  • Purchase req. item overview data

    Hi all, Does anyone know how could I get the information of purchase requisition "item overview" in ABAP way? The reason I need this is to get item category to determine whether it is standard or consignment. Please help and advice. Thanks in advance

  • OMS Service Fails

    Hi, I have installed OMS and DB 10gR2. But the problem is that the service OMS often hangs or fails to start. I am using windows 2000. There are no logs. But yes in my event viewer, i see a message OMS[servicename] failed, please contact your vendor.

  • Oracle ODBC as user works but fails as 'SYS'

    Windows 7 Oracle XE 11gR2 From Windows, I can successfully create and connect with a system data source using an user Oracle account. But when doing then same configuration process I can not create or connect using the 'SYS' account. Understandably,