You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use this specific configuration: <input type="text" currencyMask [options]="{ prefix: 'R$ ', thousands: '.', decimal: ',', allowNegative: false, align: 'left', max: 2.78 }" formControlName="entrada">
When I put the max value, 2.78, it's enter in a infinite loop. It's because the issue in float numbers, in JS. In a determinated line, the lib is trying divide the decimal numbers by 100 and sum with the integer number. So, 2 + (78/100), in JS, is returning 2.7800000000000002. When I try to compare if the number is less then the max (2.7800000000000002 < 2.78), it's call itself again and the infinite loop ocurrs.
It would be interesting if there was a new rounding in the "newValue".
PS: i've seen just in this specif number and configuration, but, perhaps, there are some another values that will trigger the same error.
The text was updated successfully, but these errors were encountered:
I'm trying to use this specific configuration:
<input type="text" currencyMask [options]="{ prefix: 'R$ ', thousands: '.', decimal: ',', allowNegative: false, align: 'left', max: 2.78 }" formControlName="entrada">
When I put the max value, 2.78, it's enter in a infinite loop. It's because the issue in float numbers, in JS. In a determinated line, the lib is trying divide the decimal numbers by 100 and sum with the integer number. So, 2 + (78/100), in JS, is returning 2.7800000000000002. When I try to compare if the number is less then the max (2.7800000000000002 < 2.78), it's call itself again and the infinite loop ocurrs.
It would be interesting if there was a new rounding in the "newValue".
PS: i've seen just in this specif number and configuration, but, perhaps, there are some another values that will trigger the same error.
The text was updated successfully, but these errors were encountered: