diff options
-rw-r--r-- | changelog/en/changelog_2022-06-15.md | 1 | ||||
-rw-r--r-- | changelog/fr/changelog_2023-01-25.md | 1 | ||||
-rw-r--r-- | ishtar_common/templates/widgets/UnitWidget.html | 4 |
3 files changed, 5 insertions, 1 deletions
diff --git a/changelog/en/changelog_2022-06-15.md b/changelog/en/changelog_2022-06-15.md index 00afabce6..a7b2a0d3e 100644 --- a/changelog/en/changelog_2022-06-15.md +++ b/changelog/en/changelog_2022-06-15.md @@ -8,6 +8,7 @@ v4.0.50 - 2999-12-31 ### Bug fixes ### - Operation form: the operation code field (Patriarche) is no longer optional +- forms - unit input: fix round float display - fix crash on qrcode generation for base finds v4.0.49 - 2023-06-21 diff --git a/changelog/fr/changelog_2023-01-25.md b/changelog/fr/changelog_2023-01-25.md index 78392e53e..65ab2fdc1 100644 --- a/changelog/fr/changelog_2023-01-25.md +++ b/changelog/fr/changelog_2023-01-25.md @@ -8,6 +8,7 @@ v4.0.50 - 2999-12-31 ### Corrections de dysfonctionnements ### - Formulaire opération : le champ code opération (Patriarche) n'est plus facultatif +- Formulaires - champ unité : correction des arrondis des flottants - Correction d'erreur lors de la génération de qrcode pour le mobilier d'origine diff --git a/ishtar_common/templates/widgets/UnitWidget.html b/ishtar_common/templates/widgets/UnitWidget.html index 1e6451708..4cd2d5728 100644 --- a/ishtar_common/templates/widgets/UnitWidget.html +++ b/ishtar_common/templates/widgets/UnitWidget.html @@ -8,9 +8,11 @@ </div> <script type="text/javascript">{% localize off %} function evaluate_{{safe_id}}(){ - value = parseFloat($("#{{id}}").val()); + value = parseFloat($("#{{id}}").val().replace(",", ".")); if(!isNaN(value)){ value = value/{{factor}}; + {% if factor > 1 %}value = value.toFixed("{{factor}}".length); + {% else %}value = value.toFixed(0);{% endif %} } else { value = 0; } |