Re: Leading zero

Discussion in 'HTML' started by Jukka K. Korpela, Oct 27, 2008.

  1. sheldonlg wrote:

    > I* have a zip code stored in my database. It has a leading zero (say
    > 01906, for example). It is stored as a varchar with the leading zero.


    I see, or maybe I don't, but that's irrelevant in HTML context.

    > When I print it out on the page,


    You don't print anything in HTML.

    > the leading zero is there. (It is
    > between a <td></td>).


    If you have <td>01906</td> in HTML, you should expect the cell content to be
    shown as 01906.

    > I also have an export to Excel routine that formats it in what is sent
    > also between <td></td>.


    Interesting, but quite irrelevant in HTML context.

    > However, in Excel it appears without the
    > leading zero (1906, for example).


    Maybe, but how does that relate to HTML?

    > How can I force the leading zero to appear?


    In HTML you have you want, in Excel you don't. What makes this an HTML
    problem?

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
     
    Jukka K. Korpela, Oct 27, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. tshad

    add leading zero

    tshad, Nov 9, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    13,406
    tshad
    Nov 9, 2005
  2. james
    Replies:
    2
    Views:
    900
    Bengt Richter
    Dec 2, 2003
  3. bobm2005

    printf question, leading zero in E format?

    bobm2005, Jun 7, 2007, in forum: C Programming
    Replies:
    4
    Views:
    450
    Barry Schwarz
    Jun 8, 2007
  4. John Nagle
    Replies:
    4
    Views:
    617
    James Antill
    Aug 7, 2007
  5. Delaney, Timothy (Tim)
    Replies:
    0
    Views:
    582
    Delaney, Timothy (Tim)
    Aug 7, 2007
Loading...

Share This Page