US-Zip-Codes-JSON icon indicating copy to clipboard operation
US-Zip-Codes-JSON copied to clipboard

ZIPs starting with zero omit first character due to storing as an INT

Open wwwroth opened this issue 10 months ago • 0 comments

I noticed what I think is a bug. Storing ZIPs as INT will omit leading zeros. Here's an example of a ZIP in NJ:

{
      "zip_code": 7837,
      "latitude": 41.12831,
      "longitude": -74.678956,
      "city": "Glasser",
      "state": "NJ",
      "county": "Sussex"
    }

This causes data loss since the first character defines the geographical region for the ZIP.

image

Would you accept a PR to convert the data type to a STRING and correct all zip codes that begin with zero?

wwwroth avatar Apr 17 '24 13:04 wwwroth