-
Notifications
You must be signed in to change notification settings - Fork 56
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
Cannot lookup AUD by number #20
Comments
The number is always a three digit/character long string. So it would be |
And yeah, it would probably be nice to move this logic into the library. So that it would check if it gets an integer so that |
@freeall Do you still accept PRs to improve this library? I'm considering contributions, including a fix for this. If you need help maintaining this repo and NPM package, I'm also happy to volunteer as a maintainer. |
^ There's my first contribution, if you'll have it :) |
If I do
number(36)
, I getundefined
, not AUD.This is because the number lookup uses string comparisons, and there is a leading zero in the currency code.
I can work around this by doing:
number(('000' + code).slice(-3))
, which inserts the leading zeros as needed. This logic should probably move into the library itself.The text was updated successfully, but these errors were encountered: