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

Allow numbers < 100 to be input #34

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ronkorving
Copy link

@ronkorving ronkorving commented Apr 1, 2021

Fixes #20

This also:

  • cleans up the test suite a bit (I added some tests, made them all fail more verbosely and categorized them).
  • fixes numbers in the readme to be string instead of integer.

@@ -18,8 +18,10 @@ var country = function(country) {
});
};
var number = function(number) {
number = ('000' + number).slice(-3);
Copy link
Author

@ronkorving ronkorving Apr 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could've used String(number).padStart(3, '0'), but that requires Node 8. I don't know which version of Node you're intending to support, not to mention browsers, but given that all the JavaScript I see here is fairly legacy, I went with the safe option.

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.

Cannot lookup AUD by number
1 participant