From e8a75ef53225ccd4d0c73a8a05f7fe6994963e3a Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Fri, 23 Aug 2024 11:35:49 +0200 Subject: [PATCH] update table --- src/lib/components/AnalystEstimate.svelte | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/lib/components/AnalystEstimate.svelte b/src/lib/components/AnalystEstimate.svelte index 43221519..743632e9 100644 --- a/src/lib/components/AnalystEstimate.svelte +++ b/src/lib/components/AnalystEstimate.svelte @@ -387,11 +387,19 @@ $: { {#each tableDataActual as item, index} - {#if index+1-tableDataActual?.length === 0} + {#if index-tableDataActual?.length === 0} - {:else} {#if item?.val === null} - - + {#if (tableDataForecast[index]?.val- tableDataForecast[index-1]?.val) > 0} + + *+{(((tableDataForecast[index]?.val-tableDataForecast[index-1]?.val) / tableDataForecast[index-1]?.val) * 100 )?.toFixed(2)}% + + {:else if (tableDataForecast[index]?.val - tableDataForecast[index-1]?.val ) < 0} + + *{(((tableDataForecast[index]?.val - tableDataForecast[index-1]?.val ) / tableDataForecast[index-1]?.val) * 100 )?.toFixed(2)}% + + {/if} {:else if (item?.val- tableDataActual[index-1]?.val) > 0} +{(((item?.val-tableDataActual[index-1]?.val) / tableDataActual[index-1]?.val) * 100 )?.toFixed(2)}% @@ -417,7 +425,9 @@ $: { - +
+ * This value depends on the forecast +
For {(new Date()).getFullYear()}, we use available quarterly data. Complete annual data, used to compare against analyst estimates, is only finalized after the year ends.