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

unformat not working with non localized delimiters #328

Closed
jkettmann opened this issue Jan 30, 2018 · 6 comments
Closed

unformat not working with non localized delimiters #328

jkettmann opened this issue Jan 30, 2018 · 6 comments
Labels

Comments

@jkettmann
Copy link
Contributor

@jkettmann jkettmann commented Jan 30, 2018

We are using different languages like en-US and de-DE where delimiters are different according to the language.

When de-DE is selected (thousand delimiter is ., decimal is ,) and we call

numbro.unformat('180.000')

the result is 180 opposed to the expected 180000. The reason is this line, which is not respecting the delimiters.

if (!isNaN(+inputString)) {
        return +inputString;
}

I guess this was added for performance reasons!? When I remove it, everything is working as expected.

@BenjaminVanRyseghem
Copy link
Owner

@BenjaminVanRyseghem BenjaminVanRyseghem commented Feb 9, 2018

thanks, I'll have a look 😄

@andi-dev
Copy link

@andi-dev andi-dev commented Oct 17, 2018

I just ran into exactly the same issue. @BenjaminVanRyseghem, do you plan to merge and release this PR? This is currently blocking my transition from numeral.js to numbro.js, which is otherwise done and working well. If I can help with anything please let me know.

@andi-dev
Copy link

@andi-dev andi-dev commented Oct 20, 2018

Thank you Benjamin, looking forward to update and remove my workaround once this makes it in a release!

@Rambobafet
Copy link

@Rambobafet Rambobafet commented Nov 16, 2018

Hi Benjamin, do you have an idea about the release date of this fix? :)
Thanks

@BenjaminVanRyseghem
Copy link
Owner

@BenjaminVanRyseghem BenjaminVanRyseghem commented Jan 18, 2019

in numbro 2.1.2

Sorry guys for the delay, tough times here 😕

@Rambobafet
Copy link

@Rambobafet Rambobafet commented Jan 18, 2019

Thanks Benjamin, wish you the best

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants