Leading Zeroes

Discussion in 'HTML' started by Kevin Marks, Apr 27, 2007.

  1. Kevin Marks

    Kevin Marks Guest

    I have a form field that takes the Credit Card ID from the back of the card.
    Sometimes this number begins with a zero. When the data goes from the form,
    there are only two digits left. Is there a way to keep the leading zero?
     
    Kevin Marks, Apr 27, 2007
    #1
    1. Advertisements

  2. Kevin Marks wrote:

    > I have a form field that takes the Credit Card ID from the back of the
    > card. Sometimes this number begins with a zero. When the data goes
    > from the form, there are only two digits left. Is there a way to keep
    > the leading zero?


    Where are you not seeing the leading zeros? In your database? In an
    email sent to you upon submit?

    My database philosophy has always been "if you don't need to do math
    with it, make it a character field." Like zip/postal code fields.
    Numeric fields will (almost) always strip leading zeros.

    --
    -bts
    -Motorcycles defy gravity; cars just suck
     
    Beauregard T. Shagnasty, Apr 27, 2007
    #2
    1. Advertisements

  3. Kevin Marks

    Kevin Marks Guest

    I think that was it. I had the field set as a number rather than a character
    field. Thanks!


    "Beauregard T. Shagnasty" <> wrote in message
    news:cQmYh.372872$...
    > Kevin Marks wrote:
    >
    >> I have a form field that takes the Credit Card ID from the back of the
    >> card. Sometimes this number begins with a zero. When the data goes
    >> from the form, there are only two digits left. Is there a way to keep
    >> the leading zero?

    >
    > Where are you not seeing the leading zeros? In your database? In an
    > email sent to you upon submit?
    >
    > My database philosophy has always been "if you don't need to do math
    > with it, make it a character field." Like zip/postal code fields.
    > Numeric fields will (almost) always strip leading zeros.
    >
    > --
    > -bts
    > -Motorcycles defy gravity; cars just suck
     
    Kevin Marks, Apr 27, 2007
    #3
    1. Advertisements

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. Peter Bluer

    Easy way to define lots of zeroes

    Peter Bluer, May 9, 2006, in forum: VHDL
    Replies:
    4
    Views:
    736
    Peter Bluer
    May 10, 2006
  2. Michal Prinke
    Replies:
    0
    Views:
    409
    Michal Prinke
    Oct 19, 2004
  3. Piotr B.
    Replies:
    2
    Views:
    628
    CBFalconer
    Oct 19, 2004
  4. cjl
    Replies:
    11
    Views:
    1,024
    Bengt Richter
    Mar 26, 2005
  5. Mike P

    csv and leading zeroes

    Mike P, Oct 4, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    667
    Jon Paal
    Oct 4, 2006
  6. vrigo

    fast check for binary zeroes in memory

    vrigo, Jul 16, 2004, in forum: C Programming
    Replies:
    7
    Views:
    421
    vrigo
    Jul 20, 2004
  7. John Nagle
    Replies:
    4
    Views:
    761
    James Antill
    Aug 7, 2007
  8. veevee1
    Replies:
    0
    Views:
    1,461
    veevee1
    Dec 14, 2009
Loading...