Displaying Leading Zeros

Having recently switched to Mac and trying to embrace the iWork applications I've struggled with something that I really couldn't find help with. Since I think this is a relatively common need I am posting this message in the event others need to present a Numbers cell that has leading zeros.
The way I have found to create leading zeros in numbers is by using the CONCATENATE and RIGHT functions. Say for example you have zip codes stored in numeric format (perhaps pulled in from a database) but need them to display in a cell properly. The zip code for Salem, NH is 03079. If you have the value 3079 stored you need that leading zero added.
Assuming 3079 is stored in A1 you could add the following formula into an adjoining field:
=RIGHT(CONCATENATE("00000",A1),5)
CONCATENATE turns A1 into a string ("000003079") and RIGHT grabs the 5 right-most characters from that string.
If someone else has a better way of handling this please do comment.

DRAlison wrote:
Having recently switched to Mac and trying to embrace the iWork applications I've struggled with something that I really couldn't find help with.
Funny comment, this 'question' was asked and responded many times in this forum.
Here are some links:
http://discussions.apple.com/thread.jspa?messageID=8278267
http://discussions.apple.com/thread.jspa?messageID=6639837
http://discussions.apple.com/thread.jspa?messageID=6126095
http://discussions.apple.com/thread.jspa?messageID=6856405
http://discussions.apple.com/thread.jspa?messageID=7474228
http://discussions.apple.com/thread.jspa?messageID=5270661
http://discussions.apple.com/thread.jspa?messageID=9394800
grabbed with a simple search in the existing threads using the keystring "leading AND zero"
Yvan KOENIG (from FRANCE mardi 30 juin 2009 16:48:06)

Similar Messages

  • F8as2-displaying leading zeros in a dynamic text field

    F8as2-
    Background:
    Currently I have to use two different text fields to display 10000 due to the different font sizes.
    The 10 is a larger font and the 000 is a smaller font.  When I assign '0 'to the dynamic text fields of the smaller font I get just that a '0' not a '000' which is what I want.
    Question:
    Is there an easy way to display leading zeros in a dynamic text field?  Or can a dynamic text field have different character positions displayed in different font sizes?  or both?
    Thanks for the help.

    F8as2-
    Thanks for the reply kglad.
    Are for saying the best way to display numerically calculated numbers that need leading zeros and or different font sizes is to convert them to a string for display purposes with textFormatting??

  • Display leading zeros in the ALV

    Hello All,
    My requirement is to display leading zeros in the ALV. The leading zeros are not getting displayed. Please suggest how do I achieve this. I have tries NO_ZERO = ' ' and lzero = ' '.
    Thanks in advance.
    Regards,
    Anju

    Here is the Sample code for your ref
    type-pools: slis.
    data: begin of t_itab occurs 0,
           col1 type matnr,
           col2 type char10,
          end of t_itab.
    data: t_fieldcat type slis_t_fieldcat_alv,
          w_fieldcat type slis_fieldcat_alv.
    t_itab-col1 = 10.
    t_itab-col2 = 'A'.
    append t_itab.
    clear t_itab.
    t_itab-col1 = 11.
    t_itab-col2 = 'B'.
    append t_itab.
    clear t_itab.
    loop at t_itab.
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          input         = t_itab-col1
       IMPORTING
         OUTPUT        = t_itab-col1 .
       modify t_itab index sy-tabix.
    endloop.
    w_fieldcat-fieldname = 'COL1'.
    w_fieldcat-lzero = 'X'.
    append w_fieldcat to t_fieldcat.
    clear w_fieldcat.
    w_fieldcat-fieldname = 'COL2'.
    append w_fieldcat to t_fieldcat.
    clear w_fieldcat.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       I_CALLBACK_PROGRAM                = sy-repid
       IT_FIELDCAT                       = t_fieldcat
       I_SAVE                            = 'X'
      TABLES
        t_outtab                          = t_itab
    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.
    Regards,
    Bhavana

  • Display Leading Zeros in bex query

    Hi,
    I am new to BI and need to display leading zeros in bex report.
    There is an info-object billing number which is of type CHAR. The values, 00001 - 00010 has been given in the CSV file.
    when i generate the same in IP, the leading zeros are mentioned, but the same is not appearing in the bex query.
    I have tried ALPHA conversion but this has no affect on the output.
    How to achieve the same??
    thanks in advance for the answers

    Hi,
    To answer your question in detail, there is a  conversion routine at infoobject level( Tab- general ), that determines how the values are displayed in the front end. For ex, alpha conversion routine takes away the leading zeros when you display the value in query. ( 0001 displayed as 1 )
    Assuming this is custom infoobject, I would suggest you to remove the conversion routine from the infoobject. This will help you in displaying leading zeros in the report.
    However, you have to ensure that all the values loaded for this infoobject is properly alpha converted ( packed with leading zeros ) by adding a field routine in the transformation. This will avoid same values getting stored with different internal formats like 01,001 etc.
    Hope this explains.
    Thanks.

  • Displaying leading zeroes

    Hi,
    I am facing a problem in displaying leading zeroes for a char in a BW report. This char has length 4 and it should show the value as 0ABC in the report but instead it displays just ABC. When checked the info providers, the data is right there.
    Technical details: length - 4, Conv Routine - ALPHA, BEx display - Key & text
    Could someone please throw some light on this?
    Thanks a lot in advance.

    Hi Bobs,
    Here is what I understood from your query;
    You have leading zeros for the char info object in the info provider but while running the query it is returning with the rest of the characters but not leading zeros?
    Yes while loading in to info provider ALPHA conversion does add any leading zeros according to the char size to load in to the info provider but while reporting it does the reverse ALPHA. but you have to check the values in the master data for the char info object where the default option for query results on char objects to retrieve key and text values from char object master tables. I think the master data for the char info object might not be have leading zeros.

  • Display leading zeros in OLE

    Hi Friends,
    When I am writing report in OLE( excel ), some of the fields which are having leading zeros automatically deleted . It shoud not happen . I have to display leading zeros also.
    Please tell me which class and method to do this ...
    Thanks ,
    Varma

    Use OLE itself to set the formatting of the cell (or column itself) to character type
    * character type for columns
    data: h_columns        TYPE ole2_object,
          h_cell           TYPE ole2_object.
    CALL METHOD OF excel 'Columns' = h_columns
      EXPORTING
        #1 = 'F:K'.
    set property of h_columns 'NumberFormat' = '@'.
    CALL METHOD OF excel 'Cells' = h_cell
      EXPORTING
        #1 = 14
        #2 = 7.
    SET PROPERTY OF h_cell 'Value' = '0001'.

  • Displaying leading zeros in ALV

    Hi experts,
      I have a field of length 12 char. I want to display the field in grid.
    My requirement is if the field is below 6 char(such as 101) i want to display as 000101 .I added logic for adding zeros up to six char but the leading zeros are supressed in my grid.
    I want as 000101 but it is showing as 101.
    I am using REUSE_ALV_FIELDCATALOG_MERGE for building the field catalog.
    How to solve this.
    Thanks & regards,
    karthik.

    Hi,
    you must work with a mask for your field like this:
      repid = sy-repid.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
           EXPORTING
                i_program_name     = repid
                i_internal_tabname = 'MY_TABLE'
                i_inclname         = repid
           CHANGING
                ct_fieldcat        = field_catal.
      Modify field for leading 000
      LOOP AT field_catal INTO w_fieldcat_alv.
        CASE w_fieldcat_alv-fieldname.
          WHEN 'NUM_FELD'.                                    "<-- this is your field
            w_fieldcat_alv-edit_mask   = '000000'.
            MODIFY field_catal FROM w_fieldcat_alv.
        ENDCASE.
      ENDLOOP.

  • How to display leading zeros in a report

    Hi folks,
    I am doing a HR report and the users are very much used to seeing a two digit numeric value as the pay scale since their legacy days.
    In BW, I have the Pay Scale defined as a character (2) and it shows the values on the report as follows:
    Pay Scale
    0
    1
    2
    3
    11, etc.
    But the users would like to see 00, 01, 02, 03, 11, etc.
    Under the query properties, display tab, there are four separate options - display zeros, show zeros as, etc. I tried all the options but the pay scale still does not show the leading zeros. I remember seeing a SAP note a while back that talks about this. Does anybody know how to force the leading zeros on the BEx report.
    Thanks.
    Abdul

    Try removing the ALPHA Conversion from info object defintion.

  • Display leading zeros

    How to take an integer with no leading zeros and display it
    with leading zeros?
    Thank you in advance.

    There are a couple of ways. Let's say you are looking for 7
    digits altogether.
    Method 1
    NewString = '0000000' & thenumber;
    NewString = right(newString, 7);
    Method 2
    while (len(thenumber) lt 7)
    thenumber = '0' & thenumber;

  • Leading zeros are not displaying in the excel

    Hi Experts,
    Leading zeros are not displaying in the excel
    Here is the situation:
    I have developed one report, which will create the file in Application server with TAB deleimeted. After that I am sending that file via email in the excel format using Email functionality FM.
    Normally our material numbers will start with zeros.
    But when I check the email excel file , leading zeros are not displaying.
    Even I checked the application server (AL11) file, zeros are there.
    I thought program FM was wrong and I tried it manually by downloading the file into excel. Eventhough it is suppressing zeros.
    Could you please advise, how to display leading zeros to the material number in excel file.
    Thanks in advance
    Raghu

    Application server file showing  zeros infront of the material number.
    1200#  0012401387# XXXXXXXX
    Once file created in app server, I am using one custom FM to send that output in excel format / txt format via email.
    when I send txt file via email, I am getting leading zeros. But when I send xls file via email, I am not getting zeros.
    I checked custom FUNCTION MODULE . No mistakes in that.
    ===
    Sudhir,
    As you said, I passed ( ' ) single quote infront of the material number. When I check the excel file, single quote also displaying like this '0000100.
    Application server file showing like below
    1200#  '0012401387# XXXXXXXX
    ===
    Could you please advise anyone how can we acheive this.
    Thanks

  • How to remove leading zero in a inputfield

    I have a inputfield UI element which is bind to a NUM type context.  When it display a number, it always come with leading zero, like '001'. Can anyone teach me how to remove the leading zero.

    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/3a/2232666aeb45f4b759848a4caf9c8b/frameset.htm
    Use the Display leading zeros formatting option in the context attribute properties.
    The other option is to use a data dictionary domain for the field that has a built in field conversion exit. The ALPHA conversion exit is commonly used on NUMC fields like Sales Order number to suppress leading zeros.  The WD runtime will automatically use the underlying DDIC Domain Field Conversion Exit.  You don't need to do anything except use that DDic to define the context.

  • Eliminate Leading Zeros in Portal

    Hi!
    I have a problem with Leading Zeros.
    I have customer details in the master table which has Telephone number and Fax number as attributes to ZCUSTOMER.
    I am running a report on this Object as a provider.
    When I see the report from BEx or Query Designer on the browser, I am not seeing any leading zeros.
    But when the same data is sent to Portal, the xml displays leading zeros as in the master data table.
    Why am I not viewing leading zeros when i run it on the browser?
    and
    How can I eliminate leading zeros display in portal?
    Please help!
    Thanks,
    Sri

    Hello Sri,
    I'm facing the same problem. Could you please explain what you did in portal to solve it.
    Thanks in advance

  • Remove leading zeros from table

    Hi everyone,
    I have a NUMC filed with length 3. my problem is that in WDA Table, the values are displayed with leading zeros:
    010, 020, 030
    I'd like to get thesevalues without the zeros : 10,20,30,
    Is this possible somehow? (without modifíing the type of the binded field)
    Thanks
    N.

    Do you have table comming from CONTEXT Node ?
    if yes then you can exapnd your context node , locate the attribute , select it. Now you should see  in bottom pane
    PROPERTY
    FORMATTING
    Display leading zeros -  set this to set 'ZERO's as Blank'
    -Prashant

  • Reg : leading zeroes

    Hi,
    How to display leading zeroes for the numbers in the output?
    can we use no edit-mask?
    Thanks in advance,
    Sowmya.

    Hi
      use this FM
    CONVERSION_EXIT_ALPHA_INPUT
    to add the leading zeros and
    use this FM
    CONVERSION_EXIT_ALPHA_OUTPUT
    to supress the leading zeros in display.
    Regards,
    kumar

  • Declaratice Custom Componente - leading zeros

    Hello,
    i'm currently building some custom components in JDev 11.1.2.3.0. Now sometimes it happens that some input fields are displaying 4 digits and they must display leading zeros, if those values are smaler than 4 digits.
    I've tried it via the convertNumber component, it is displaying a single 0 if i give the pattern 0000 and those input fields are empty, but i could input some values with less than 4 digits and the required leading zero is gone.
    So, how is the corect behaviour with always leading zeros for less than 4 digits achieved?
    Thanks and best regards.
    Alex

    Frank Nimphius wrote:
    Hi,
    numbers are not showing leading numbers.Converting numbers into Strings thus is the way to go.
    FrankBut where could i define the format for the string?

Maybe you are looking for

  • HP2540 can no longer be contacted wirelessly. (SOLVED)

    Having installed the printer under Linux using CUPS 1.4. I used the Wireless Direct connection to connect to it via my browser and http://192.168.223.1 and set the security to off as we have no neighbours and the router too is unsecured. The printer

  • Transparent windows - bug?

    HI Everyone, today my imac at work did something quite extravagant - not sure if it's a bug or not? (I'd actually like to replicate this at will) basically, while swapping back and forth through windows, everything became transparent but for chrome (

  • No authorization for archiving device

    hi while archiving the document from coebr trasaction, I am getting following error. No authorization for archiving device Message no. PT041 Diagnosis In archive customizing, you can assign an archive device to an archive. Otherwise, the value from t

  • When will firefox stop supporting 3rd party cookies by default much like Safari does now?

    Safari by default doesn't accept 3rd party cookies and there have been reports that Firefox will follow suit. Any information in terms of the timeline as to when this will come into effect would be much appreciated! Thanks,

  • Need to change QMS$ITEM_FONT

    I need to change the font size of all generated items from 8 to 10. I don't want to change QMSOLM65.fmb in order to allow future upgrades. My problem is that I can't see any way to change the QMS$ITEM_FONT visual attribute without also copying most,