country-code-lookup icon indicating copy to clipboard operation
country-code-lookup copied to clipboard

isoNo returns non-standardized format

Open nycodinguru opened this issue 2 years ago • 1 comments

Running the isoNo method can return a single or two character string. For example, looking up Afghanistan's ISO numeric-3 country code returns '4' instead of '004'. This can be fixed by enforcing string length of 3 for isoNo values and adding leading zeros as padding using JS's padStart method. I'd be happy to help you implement this if you want some assistance. 🙂

nycodinguru avatar Apr 05 '23 17:04 nycodinguru

yes, I agree, they should be 3 digits with a padding of zeros. I would prefer to fix in the source data if possible. Which is something I'll look at later today.

richorama avatar Apr 09 '23 15:04 richorama