primeng icon indicating copy to clipboard operation
primeng copied to clipboard

p-inputnumber: Not allowing to start the decimal with DOT(.)

Open RanjithkumarRajendran opened this issue 1 year ago • 5 comments

Reopened the ticket - https://github.com/primefaces/primeng/issues/16069

Describe the bug

Describe the bug <p-inputNumber [min]="1" [max]="24" [minFractionDigits]="1" [maxFractionDigits]="2"

In the above input number,

Below cases are working

If i am trying to enter 0.5, it is working if I am trying to enter 5.75 it is working Case which is not working. if i am trying to enter as .5, i can see only 5 (dot is missing) if we need dot, we need to start with 0.

Tried same thing in primeng component as well- https://primeng.org/inputnumber

Pull Request Link

No response

Reason for not contributing a PR

  • [ ] Lack of time
  • [ ] Unsure how to implement the fix/feature
  • [ ] Difficulty understanding the codebase
  • [ ] Other

Other Reason

No response

Reproducer

https://stackblitz.com/edit/inputnumber-github-hhjujy-qamqwj?file=src%2Fapp%2Fapp.component.html

Environment

All

Angular version

17.3.12

PrimeNG version

v19

Node version

20.12.2

Browser(s)

Chrome

Steps to reproduce the behavior

Go to the text box enter the value as .5, your will see as 5

Expected behavior

Go to the text box enter the value as .5, your have to see as .5 or 0.5 (auto prefixed with 0 if it started with .)

RanjithkumarRajendran avatar Dec 27 '24 05:12 RanjithkumarRajendran

@mertsincan for your reference, creating the issue.

RanjithkumarRajendran avatar Dec 27 '24 05:12 RanjithkumarRajendran

Thanks a lot for the update!

mertsincan avatar Dec 27 '24 11:12 mertsincan

Same issue still exists, basically makes this component unusable for my users as they don't enter the leading 0.

JacobSiegle avatar Nov 06 '25 20:11 JacobSiegle

Would love to get this added. Would be great to allow users to enter decimals without a leading zero

djrcawley avatar Jan 28 '26 03:01 djrcawley

yea no one types 0 before entering a decimal... this is a big problem.

nawlbergs avatar Jun 18 '26 20:06 nawlbergs