digitalfabrik / integreat-cms

Simplified content management back end for the Integreat App - a multilingual information platform for newcomers
https://digitalfabrik.github.io/integreat-cms/
Apache License 2.0
56 stars 34 forks source link

Fix HIX value display #2853

Closed MizukiTemma closed 2 months ago

MizukiTemma commented 3 months ago

Describe the Bug

After #2760 some unwanted changes have been introduced together: HIX value is shown as 9 instead of 9.73 and mouseover does not show the detailed HIX value anymore

Steps to Reproduce

  1. Activate HIX in Region Augsburg (in the local emvironment), set the user language to German
  2. Populate pages with HIX value by ./tools/integreat-cms-cli hix_bulk augsburg
  3. Go to the page "Gesundheitsamt" (for example), whose raw HIX score is 9,72960372960373.
  4. See "9" in the HIX bar and mouseover doesn't show anything

Expected Behavior

It shows "9.73" and mourseover reveals the exact HIX score "9,72960372960373"

Actual Behavior

It shows 9 and mouseover doesn't do anything

Additional Information

The problem 9 vs 9.73 can only be observed if German is selected in the user setting. This is due to the different style between German (9,73, with comma) and English (9.73 with dot) and parseFloat().

For more information and context, see #2756

Traceback ``` ```
MizukiTemma commented 3 months ago

@dkehne Please confirm whether this is describing the wished status correctly or leave comments 🙏

dkehne commented 3 months ago

The mouseover is not necessary as long

  1. you show HIX-value with 2 comma digits e.g. 9.73 and NOT as 9
  2. The rounding up works well. So 9.735 is shown AND handled as 9.74. So if we would decrease the MT-threshold to 9.74, a value with 9.735 should work to translate
MizukiTemma commented 3 months ago

@dkehne Thank you for quick reply 👍