react-currency-input-field icon indicating copy to clipboard operation
react-currency-input-field copied to clipboard

FixedDecimalLength prop + onBlur changes intended input value

Open ncharris93 opened this issue 3 years ago • 5 comments

Describe the bug If the prop fixedDecimalLength is set, when onBlur is triggered, numbers such as 200 will change to 2.00

123 » 1.23 350 » 3.50 etc

To Reproduce Steps to reproduce the behavior:

  1. Go to forked sandbox
  2. remove the default value
  3. Enter 200
  4. click in the whitespace to trigger onBlur

Expected behavior The input value of 200 would change to 200.00

Code Sandbox

Forked Sandbox

Additional context I see that there are tests to actually show this is intended behavior (?!)

So I guess I should just fork this repo, or will this request be addressed?

ncharris93 avatar Jan 12 '22 14:01 ncharris93

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 16 '22 02:03 stale[bot]

bump

ncharris93 avatar Mar 16 '22 16:03 ncharris93

Bump?

makis-spy avatar May 20 '22 16:05 makis-spy

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 21 '22 06:07 stale[bot]

For people like me having the same issue (123 becomes 1.23) and arriving here: Instead of using fixedDecimalLength, you just need to use decimalScale

chriskaya avatar Jul 29 '22 08:07 chriskaya

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 27 '22 19:09 stale[bot]