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

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

thanks, I'll have a look 😄

@andi-dev
Copy link

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

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

@spicq-rambobafet
Copy link

spicq-rambobafet commented Nov 16, 2018

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

@BenjaminVanRyseghem
Copy link
Owner

in numbro 2.1.2

Sorry guys for the delay, tough times here 😕

@spicq-rambobafet
Copy link

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
Development

No branches or pull requests

4 participants