Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InputNumber: Incorrect default value for minFractionDigits when set to null #6761

Closed
navedqb opened this issue Jun 14, 2024 · 0 comments · Fixed by #6762
Closed

InputNumber: Incorrect default value for minFractionDigits when set to null #6761

navedqb opened this issue Jun 14, 2024 · 0 comments · Fixed by #6762
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@navedqb
Copy link
Contributor

navedqb commented Jun 14, 2024

Describe the bug

When InputNumber is used with the minFractionDigits attributes explicitly set to null, the default value used by the control is 0.
https://primereact.org/inputnumber/#api.InputNumber.props.minFractionDigits

It is described in the documentation "the default for currency formatting is the number of minor unit digits provided by the ISO 4217 currency code list"

Reproducer

https://stackblitz.com/edit/mwqeju?file=src%2FApp.jsx

PrimeReact version

10.6.6

React version

17.x

Language

TypeScript

Build / Runtime

Create React App (CRA)

Browser(s)

Chrome

Steps to reproduce the behavior

  1. Use an InputNumber component where the minFractionDigits and maxFractionDigits are explicitly set to null in currency mode.
  2. Enter a value

Default value is 0 fractional digits

Expected behavior

Default value should be 2 fractional digits in currency mode

@navedqb navedqb added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jun 14, 2024
@melloware melloware added Type: Bug Issue contains a defect related to a specific component. and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Jun 14, 2024
@melloware melloware added this to the 10.7.0 milestone Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants