question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

InputNumber: decimalPlaces not defaulting correctly on numeric types with null value

See original GitHub issue

Describe the bug

If the value is null the type of the bound value should be checked

https://github.com/primefaces/primefaces/blob/fcced6df36579bc34f09b03b683f31fdee8f0ce3/primefaces/src/main/java/org/primefaces/component/inputnumber/InputNumberRenderer.java#L393-L395

Reproducer

Bind to an Integer type of which the value is null

Expected behavior

decimalPlaces should be 0 instead of 2, because the value is of type Integer although the value is null.

PrimeFaces edition

Community

PrimeFaces version

12

Theme

No response

JSF implementation

No response

JSF version

No response

Browser(s)

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
tandraschkocommented, Aug 25, 2022

fixed it, please check

1reaction
jepsarcommented, Aug 19, 2022

I’ll take care of it. Should not be too hard. I just haven’t found the time yet.

Read more comments on GitHub >

github_iconTop Results From Across the Web

p:inputNumber: Too restrictive for double/float values #5573
The p:inputNumber component Is too restrictive and thus not really useful for double/float values. By default, the decimalPlaces attribute ...
Read more >
Allow 2 decimal places in <input type="number">
According to MDN, pattern doesn't work for input type=number : <input type="number"> elements do not support use of the pattern attribute for ...
Read more >
Available number formats in Excel - Microsoft Support
Used for general monetary values and displays the default currency symbol with numbers. You can specify the number of decimal places that you...
Read more >
Formatting Your Angular Number to 2 Decimal Places
We have a number 12.45343532 . We want it to look like this: 12.45 . Approach. Within the component template pipe the value...
Read more >
Documentation: 15: 8.1. Numeric Types - PostgreSQL
Thus, we have created an integer column and arranged for its default values to be assigned from a sequence generator. A NOT NULL...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found