LightningFlowComponents icon indicating copy to clipboard operation
LightningFlowComponents copied to clipboard

*Datatable 4.0.5* - _percentage field_ - Locale is messing up the percentage visualization

Open segdan opened this issue 3 years ago • 1 comments

Steps to reproduce

Steps to reproduce the behavior:

  1. set user locale to Germany(Germany). The problem is present also with others locale (italy, spain, france, etc..)
  2. create a record with a percentage field with a value of 0.1000000000000001 or any number with 16 decimal digits
  3. use the datatable component to show that record
  4. notice that the percentage is multiplied by 1000000000000000

Expected behaviour

the percentage field should be showed as it is set in the record

Actual behaviour

the percentage field is multiplied by 1000000000000000 and the component shows an incorrect percentage

Screenshots

image

Additional notes

the problem disappears with locale equals to English(US) or English(UK)

segdan avatar Jul 05 '22 08:07 segdan

I've looked into this issue and I'm unable to resolve it at this time. The conversion is happening when passing the value from the LWC to the Apex controller. The LWC has the correct format but the Apex initializes with the incorrect value.

I suggest trying to use decimal fields instead of percent fields and see if that works differently for you.

ericrsmith35 avatar Jul 08 '22 19:07 ericrsmith35