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 2 years ago • 6 comments

Describe the bug

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

In the above input number,

Below cases are working

  1. If i am trying to enter 0.5, it is working
  2. 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.

Environment

All

Reproducer

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

Angular version

17.3.12

PrimeNG version

17.18.9

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

20.12.2

Browser(s)

Chrome

Steps to reproduce the behavior

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

Expected behavior

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

RanjithkumarRajendran avatar Jul 19 '24 15:07 RanjithkumarRajendran

I have to add my support to this problem. This particular issue is driving my users CRAZY and although it's a seemingly minor behaviour problem it seems to be a major pain point amongst our community.

wcroteau avatar Aug 02 '24 18:08 wcroteau

I am using the latest version of 17.18.9 still, we are facing the issues. Any workarounds or solutions to fix this

RanjithkumarRajendran avatar Sep 21 '24 00:09 RanjithkumarRajendran

@wcroteau Do you have any work around or solutions to fix this in Primeng?

RanjithkumarRajendran avatar Sep 30 '24 12:09 RanjithkumarRajendran

Hi,

So sorry for the delayed response! Improvements have been made to many components recently, both in terms of performance and enhancement. Therefore, this improvement may have been developed in another issue ticket without realizing it. You can check this in the documentation and try the latest PrimeNG version(v19). If there is no improvement on this, can you open a new issue so we can include it in our roadmap?

Thanks a lot for your understanding! Best Regards,

mertsincan avatar Dec 25 '24 13:12 mertsincan

@mertsincan Thank you for the response, Have tried with the latest Primeng version (V19), there is no fix for this. Will open the issue again.

Here is the new Issue - https://github.com/primefaces/primeng/issues/17226

RanjithkumarRajendran avatar Dec 27 '24 05:12 RanjithkumarRajendran

This still seems to be occurring.... or has re-occurred.

https://primeng.org/inputnumber Go to the 'Min-Max Fraction Digits' under 'Numerals'... cant start the number with a .

I came here because Im having this issue in my app.

(i jsut saw the post above.. will go there. sorry.)

nawlbergs avatar Jun 18 '26 19:06 nawlbergs