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

NumeralFormatter formats expecting the input to have the given comma delimiter #77

Closed
MattiSG opened this issue Aug 12, 2016 · 4 comments
Labels

Comments

@MattiSG
Copy link

MattiSG commented Aug 12, 2016

More precisely:

new Cleave(element, {
    numeral: true,
        numeralThousandsGroupStyle: 'thousand',
        numeralDecimalMark: ',',
        delimiter: ' '
    }
).properties.numeralFormatter.format('1200.24')  // yields “120 024”, should be “1 200,24”

I understand the sense it makes to account for the numeralDecimalMark to be given by the user, but it prevents setting the value to a raw JS Number.


Not sure this is an issue with Cleave or with my use-case.

@nosir
Copy link
Owner

nosir commented Aug 13, 2016

Seems you found a bug, will fix soon. Thanks
But instead of calling .properties.numeralFormatter...., you should call the public method setRawValue.

@nosir nosir added the bug label Aug 13, 2016
@nosir
Copy link
Owner

nosir commented Aug 13, 2016

Ok, released, you should use it like this:
https://jsfiddle.net/4hfo4vnq/7/

@MattiSG
Copy link
Author

MattiSG commented Aug 13, 2016

Thanks @nosir for the quick reply! 😃

I had understood how I was supposed to use the public method, but I used this private access to use Cleave as a formatter for a non-<input> element too. That's actually a separate issue that I described in #80.

@nosir
Copy link
Owner

nosir commented Aug 13, 2016

Cool, so will close this as well.

Hopefully, #79 will help with your implementation.

@nosir nosir closed this as completed Aug 13, 2016
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

2 participants