ngx-mask icon indicating copy to clipboard operation
ngx-mask copied to clipboard

Percent pipe should allow negative percentages starting with 0 and support to start with '-' character

Open durmuse opened this issue 1 year ago • 3 comments

Hi,

I have run into the following issues while using 'percent.2' pipe with negative numbers:

  1. Negative number sign(-) can only be applied after the number is typed, So I end up having to go back to the first character to place the negative sign. The mask should allow us to start typing with "-" character also.
  2. Currently mask only allows numbers equal to or greater than 1 to be negative. I'd like to have negative percentages starting with 0 also (-0.12%, -0.25%, etc.)

Thanks.

durmuse avatar Dec 18 '23 14:12 durmuse

Not sure if related, but seems allowNegativeNumbers is not behaving as anticipated in general. The demos/examples at https://jsdaddy.github.io/ngx-mask/#11 do not appear to be functioning as expected.

tkutcher avatar Jan 23 '24 22:01 tkutcher

@durmuse try add prefix="-" to input

joshuaGnol avatar Mar 01 '24 09:03 joshuaGnol

@joshuaGnol : In my case user can enter both positive and negative numbers so I should not use a prefix.

durmuse avatar Mar 01 '24 12:03 durmuse

@durmuse @tkutcher @joshuaGnol Thanks for using Ngx-mask. Please update to latest version. It example all work as expected - https://stackblitz.com/edit/stackblitz-starters-cvpjyk?file=src%2Fmain.ts

andriikamaldinov1 avatar Mar 25 '24 10:03 andriikamaldinov1

I can start with - now for positive numbers, but I still can't type in any negative input starting with 0 (-0.12, -0.25 etc)

On Mon, Mar 25, 2024 at 6:51 AM Andrii Kamaldinov @.***> wrote:

@durmuse https://github.com/durmuse @tkutcher https://github.com/tkutcher @joshuaGnol https://github.com/joshuaGnol Thanks for using Ngx-mask. Please update to latest version. It example all work as expected - https://stackblitz.com/edit/stackblitz-starters-8ebtka?file=src%2Fmain.ts

— Reply to this email directly, view it on GitHub https://github.com/JsDaddy/ngx-mask/issues/1292#issuecomment-2017717998, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJZYNCLNUR4T6E6DM2CRO3YZ76SFAVCNFSM6AAAAABAZS35XSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJXG4YTOOJZHA . You are receiving this because you were mentioned.Message ID: @.***>

durmuse avatar Mar 25 '24 14:03 durmuse

@durmuse Please update to latest version. It example - https://stackblitz.com/edit/stackblitz-starters-temmpb?file=src%2Fmain.ts

andriikamaldinov1 avatar Mar 27 '24 12:03 andriikamaldinov1