s-yadav / react-number-format

React component to format numbers in an input or as a text.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Difference between NumericFormat component and numericFormatter function

thiengo105 opened this issue · comments

Describe the issue and the actual behavior

numericFormatter function should return the same value as NumberFormat component with the same props.
image

Describe the expected behavior

numericFormatter should return 3.91 instead of 3.90

Provide a CodeSandbox link illustrating the issue

https://codesandbox.io/p/sandbox/react-number-format-gnsqpq

Provide steps to reproduce this issue

use the following props to pass to numericFormatter function and NumerFormat component:

value = 3.9082;
decimalScale = 2;

Please check the browsers where the issue is seen

  • Chrome
  • Chrome (Android)
  • Safari (OSX)
  • Safari (iOS)
  • Firefox
  • Firefox (Android)