From cc2a13778357e431b9cd763ef54df10191af0320 Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Mon, 28 Feb 2022 20:59:58 +0100 Subject: [PATCH] Fixed calories locale number display (fixes #1802) --- changelog/67_UNRELEASED_xxxx-xx-xx.md | 1 + public/js/grocy.js | 2 +- views/recipes.blade.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/changelog/67_UNRELEASED_xxxx-xx-xx.md b/changelog/67_UNRELEASED_xxxx-xx-xx.md index 7d7d684c..87be95ec 100644 --- a/changelog/67_UNRELEASED_xxxx-xx-xx.md +++ b/changelog/67_UNRELEASED_xxxx-xx-xx.md @@ -18,6 +18,7 @@ - Fixed that consuming recipes was possible when not all ingredients were in-stock (and this potentially consumed some of the in-stock ingredients; not matching the message "nothing removed") - Fixed that the price of the "Produces product"-product, which is added to stock on consuming a recipe, was wrong (was the recipe total costs multiplied by the serving amount instead of only the recipe total costs) +- Fixed that calories of recipe ingredients were displayed with an indefinite number of decimal places ### Meal plan diff --git a/public/js/grocy.js b/public/js/grocy.js index 2cc6f772..c634b035 100644 --- a/public/js/grocy.js +++ b/public/js/grocy.js @@ -637,7 +637,7 @@ function RefreshLocaleNumberDisplay(rootSelector = "#page-content") } var value = parseFloat(text); - $(this).text(value.toLocaleString(undefined, { minimumFractionDigits: 0, maximumFractionDigits: 2 })); + $(this).text(value.toLocaleString(undefined, { minimumFractionDigits: 0, maximumFractionDigits: 0 })); }); } RefreshLocaleNumberDisplay(); diff --git a/views/recipes.blade.php b/views/recipes.blade.php index 9475b9b6..245360df 100644 --- a/views/recipes.blade.php +++ b/views/recipes.blade.php @@ -481,7 +481,7 @@ @endif @if($selectedRecipePosition->need_fulfilled == 1 && GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING) {{ $selectedRecipePosition->costs }} @endif - {{ $selectedRecipePosition->calories }} {{ $__t('Calories') }} + {{ $selectedRecipePosition->calories }} {{ $__t('Calories') }} @if(!empty($selectedRecipePosition->recipe_variable_amount))
{{ $__t('Variable amount') }}
@endif