From 21865a35d95662a63d66af7303ff3eba98deea95 Mon Sep 17 00:00:00 2001 From: Jaroslav Drzik Date: Mon, 25 Mar 2024 18:36:15 +0100 Subject: [PATCH] Fix rate calculation --- resources/js/Pages/IkeaRoot.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/js/Pages/IkeaRoot.vue b/resources/js/Pages/IkeaRoot.vue index 4df68ba..047b417 100644 --- a/resources/js/Pages/IkeaRoot.vue +++ b/resources/js/Pages/IkeaRoot.vue @@ -110,7 +110,9 @@ const tproducts = computed(() => { prod.salesPrice = Math.round(prod.salesPrice * 100) / 100; prod.calcPrice = Math.round(prod.calcPrice * settingsStore.currencyCoef * 100) / 100; - prod.rate = currencyHash.value[prod.currency]; + console.log('CHA=',currencyHash.value[prod.currency]); + prod.rate = + Math.round((currencyHash.value[prod.currency] == undefined? 1.0 : currencyHash.value[prod.currency] ) / (settingsStore.currency != "EUR" ? currencyHash.value[settingsStore.currency] : 1.0)*100)/100; if (prod.tag != null && prod.tag.length > 1) prod.tag = prod.tag.replace(/_/g, " "); return prod; });