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

Number cast bug #791

Closed
eggp opened this issue Sep 2, 2020 · 1 comment
Closed

Number cast bug #791

eggp opened this issue Sep 2, 2020 · 1 comment

Comments

@eggp
Copy link

eggp commented Sep 2, 2020

Error details:

In this case, if you initialize FormControl with values of number type and 2 decimal places, the type of stored values changes to string. For this I created a patch in which we automatically detect the separatorLimit value and cast the Number.toFixed (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed return value type is string) to a number.


Demo stackblitz example
If we comment on lines 9-21 in the main.ts, the error occurs: in the first field a decimal value has to be deleted and the value stored in control becomes a string type. Putting the patch back on solves this.

@NepipenkoIgor NepipenkoIgor mentioned this issue Nov 24, 2020
12 tasks
NepipenkoIgor added a commit that referenced this issue Nov 24, 2020
* fix: issue with number cast [ref:#791,#705]

* fix: changelog desc [ref:#791,#705]

* fix: up package version [ref:#791,#702]

Co-authored-by: Igor Nepipenko <[email protected]>
@NepipenkoIgor
Copy link
Collaborator

@eggp Thank you for using library. Please try version v11.1.1

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