Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some en_US ZIP codes are only 4 characters when a state is specified #2277

Closed
matthewmayer opened this issue Jul 26, 2023 · 0 comments · Fixed by #2278
Closed

Some en_US ZIP codes are only 4 characters when a state is specified #2277

matthewmayer opened this issue Jul 26, 2023 · 0 comments · Fixed by #2278
Assignees
Labels
c: bug Something isn't working m: location Something is referring to the location module p: 1-normal Nothing urgent
Milestone

Comments

@matthewmayer
Copy link
Contributor

Reported at #2276

const {fakerEN_US} = require("@faker-js/faker")
fakerEN_US.location.zipCodeByState("NH") //3442
fakerEN_US.location.zipCode({state:"NH"}) //3442

This should be left-zero-padded.

This is caused by the fact that the postcode_by_state definitions treat the ZIP codes as integers

@matthewmayer matthewmayer self-assigned this Jul 26, 2023
@matthewmayer matthewmayer added the m: location Something is referring to the location module label Jul 26, 2023
@matthewmayer matthewmayer added c: bug Something isn't working p: 1-normal Nothing urgent labels Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: bug Something isn't working m: location Something is referring to the location module p: 1-normal Nothing urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant