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
Currently i can set the thousands separator as point or comma. If i set it to comma, the point button doesn't add a separator.
I suggest that the comma also should be allowed and replaced with the desired separator (.)
I set comma as separator, but point adds a comma and viceversa.
i have to use a separate directive to catch input and add this feature in order to achieve this but mobile is a bit trickyer to do when the directive itself could add this as an optional feature
Thanks!
The text was updated successfully, but these errors were encountered:
Hi Mario, while this behavior is not native, I think the inputTrasnformFn (https://jsdaddy.github.io/ngx-mask/#1) may help you. It is easier than "use a separate directive".
Set the follow function in this property:
privateswapCommaPeriodSeparator(rawValue: string): string {constdefaultDecimalSeparator=',';const[lastCharacter]=rawValue.split('').reverse();constisLastCharacterSeparator=['.',','].includes(lastCharacter);constisValidDecimalSeparator=lastCharacter===defaultDecimalSeparator;if(!isLastCharacterSeparator||isValidDecimalSeparator){returnrawValue;}// Remove the last character and add the decimal separatorconstformattedValue=rawValue.slice(0,-1).concat(defaultDecimalSeparator);returnformattedValue;}
🚀 feature request
Currently i can set the thousands separator as point or comma. If i set it to comma, the point button doesn't add a separator.
I suggest that the comma also should be allowed and replaced with the desired separator (.)
I set comma as separator, but point adds a comma and viceversa.
i have to use a separate directive to catch input and add this feature in order to achieve this but mobile is a bit trickyer to do when the directive itself could add this as an optional feature
Thanks!
The text was updated successfully, but these errors were encountered: