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

AutoNumeric.format() and AutoNumeric.unformat() do not accept named options #474

Closed
AlexandreBonneau opened this issue Aug 3, 2017 · 0 comments
Assignees
Labels

Comments

@AlexandreBonneau
Copy link
Member

AlexandreBonneau commented Aug 3, 2017

Expected behavior

Using autoNumeric 4.0.2:

expect(AutoNumeric.format(1234.56, AutoNumeric.getPredefinedOptions().euro)).toEqual('1.234,56\u202f€');
expect(AutoNumeric.format(1234.56, 'euro')).toEqual('1.234,56\u202f€');

and

expect(AutoNumeric.unformat('1.234,56\u202f€', AutoNumeric.getPredefinedOptions().euro)).toEqual('1234.56');
expect(AutoNumeric.unformat('1.234,56\u202f€', 'euro')).toEqual('1234.56');

Actual behavior

expect(AutoNumeric.format(1234.56, AutoNumeric.getPredefinedOptions().euro)).toEqual('1.234,56\u202f€'); // Works
expect(AutoNumeric.format(1234.56, 'euro')).toEqual('1.234,56\u202f€'); // Fail with '1,234.56'

and

expect(AutoNumeric.unformat('1.234,56\u202f€', AutoNumeric.getPredefinedOptions().euro)).toEqual('1234.56'); // Works
expect(AutoNumeric.unformat('1.234,56\u202f€', 'euro')).toEqual('1234.56'); // Fail with `NaN`

AutoNumeric.format() and AutoNumeric.unformat() do not take named options into account.

@AlexandreBonneau AlexandreBonneau self-assigned this Aug 3, 2017
@AlexandreBonneau AlexandreBonneau changed the title AutoNumeric.format() does not accept named options AutoNumeric.format() and AutoNumeric.unformat() do not accept named options Aug 3, 2017
AlexandreBonneau added a commit that referenced this issue Aug 3, 2017
… not accept named options

Signed-off-by: Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>
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

1 participant