Thread: Dropping Zeroes

  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Rep Power

    Dropping Zeroes

    I have been thrust into this role and this is the my first time looking at XML Code and I am stumped :

    I am supporting a piece of code that is generating check data. This XML code is working nice but when it extracts a zip code field that begins with a leading Zero it is dropping that zero and making the Zip invalid( example zip 06060 is appearing as 6060).

    I have never worked with XML before so how can I add a zero if zip code length < 5 characters ?

    Below is the XML piece that extracts the zipcode:

    <Element type="DataElement" length="10" padchar="" justify="R" field="Summary/Address/PostCode" />

    I need to leave the length at 10 to allow for addresses with ZIP+4, so just 0 padding fixed my issue but created another.

    save the Noob and save the world
  2. #2
  3. Impoverished Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Washington, USA
    Rep Power
    It's not really a question of XML: whatever code that generated the XML is what you have to fix.
    Sounds like it's treating the zip code as a number when it shouldn't?

IMN logo majestic logo threadwatch logo seochat tools logo