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

Format "0.*" and "TypeError: Cannot read property 'length' of undefined" #229

Open
SebastianBaltes opened this issue Nov 21, 2016 · 1 comment

Comments

@SebastianBaltes
Copy link

If the format is "0.*" and the value has no decimal places like the value 1, then numbro throws a "TypeError: Cannot read property 'length' of undefined".

The reason is code like value.toString().split('.')[1].length at a few places around line 647. A quick fix is to use (value.toString().split('.')[1]||'').length instead. Search for all code occurences of .split('.')[1].

@mguida22
Copy link
Contributor

This should be fixed with the changes from https://github.com/foretagsplatsen/numbro/pull/222

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

No branches or pull requests

2 participants