design-system icon indicating copy to clipboard operation
design-system copied to clipboard

Decimal numbers formatted with comma as decimal separator fail ...

Open spenya opened this issue 1 year ago • 3 comments

Bug report

Required System information

  • Node.js version: 14.19.3
  • NPM version: 6-14-17
  • Strapi version: 4.1.12
  • Database: Mysql
  • Operating system: Ubuntu

Describe the bug

I've a numeric field for a price, decimal 2.22 I use the Spanish locale where the comma is the decimal separator, I've tried it with different browsers, operating systems and computers, and the same thing happens everywhere. When you enter a number with decimals an erratic behavior is generated, as it shows points then commas, then deletes them, etc. a chaos. Better watch the video to have a good idea...

Steps to reproduce the behavior

  1. Add a numeric field
  2. Supose that set your regional configuration as Spain,
  3. Fill the field with numbers
  4. Enjoy the error

Expected behavior

Use always same decimal separator as the regional config ... and don't change the value multipling it for 100

Screenshots

https://user-images.githubusercontent.com/631200/178746215-e2f16e43-8f80-469c-a4a2-b7720d46659a.mov

spenya avatar Jul 13 '22 13:07 spenya

Hi, @gu-stav
Not sure why this issue has been moved here? from my point of view this is a bug affecting the Admin Panel

spenya avatar Jul 17 '22 22:07 spenya

@spenya I believe the issue starts at the NumberInput design-system component.

gu-stav avatar Jul 18 '22 07:07 gu-stav

@spenya I believe the issue starts at the NumberInput design-system component.

Thanks for the response ! I'm new to strapi ...

spenya avatar Jul 18 '22 07:07 spenya