Skip to content

fix(nz/ird): format 9-digit numbers as nnn-nnn-nnn - #271

Merged
koblas merged 1 commit into
koblas:mainfrom
spokodev:fix/nz-ird-format
Nov 20, 2026
Merged

koblas merged 1 commit into
koblas:mainfrom
spokodev:fix/nz-ird-format

Conversation

@spokodev

Copy link
Copy Markdown
Contributor

format() splits every IRD number after the 2nd and 5th digit, so a 9-digit number comes out as 04-909-1850 instead of 049-091-850. Every number from 100,000,000 up has 9 digits, and so does the zero-padded form of an 8-digit one. The OECD TIN sheet cited in the module gives the format as "99-999-999 or 999-999-999" (Section II), and python-stdnum returns 049-091-850.

9-digit numbers are now split after the 3rd and 6th digit. 8-digit numbers and other lengths format as before. The formats patterns, generated from the old output in #258, now list nnn-nnn-nnn instead of nn-nnn-nnnn.

@koblas
koblas merged commit a2cfc80 into koblas:main Nov 20, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants