Hi, I have an issue with the thousand separator mask and negative numbers.
Have this function in my component
getIncome() {
const testValue = 5 - 1000;
return testValue;
// testValue output is -995
}
Have this expression in my template
<div>
{{ getIncome() | mask: 'dot_separator' }}
// expression outputs -99
// should output -995
</div>
The output is cutting off the last number from a negative number. I looked through the documentation and issues and I can't find any issues or fixes related to this.
H
@cnthiesen you should write like this
< div mask="dot_separator" > {{ getIncome()}} </div>
Hi!
@ValeriaKochegarova
I have a problem with negative numbers and comma separator, it's not working. I tried this example and I can't make it work. I can't use negative in inputs, and when I use pipe the negative character it's not shown. What I'm doing wrong? Should I have to install something else? My angular version is: 7.2.4 and ngx-mask version: 7.9.2 .
I hope you can help me. Thanks!
Again they close this issue without a resolution. good job.
I still can't use negative numbers on version 8.0.5
@NepipenkoIgor
stackblitz: https://stackblitz.com/edit/chimung-angular-8-ngx-mask
Change the ngx-mask version to 9.0.0 in the stackblitz and try again. It's fixed, the only thing broke is the pipe as that doesn't cater for negative numbers currently.
Hi @ColinMorris83 , but it seem has peer deps on angular 9. Does it working correctly in angular 8 ? Thanks for quick response.
I think most likely it needs to be angular 9 as that will use typescript 3.8, same version used to build the library. You can try with 8 though, it seems to work ok in the stackblitz which is angular 8.
Most helpful comment
Again they close this issue without a resolution. good job.