This commit is contained in:
MuslemRahimi 2024-12-09 10:36:37 +01:00
parent ab6e7419f3
commit 08e0c59993
2 changed files with 20 additions and 11 deletions

View File

@ -21,7 +21,11 @@
$: { $: {
if ($stockTicker && typeof window !== "undefined") { if ($stockTicker && typeof window !== "undefined") {
rawData = data?.getNextEarnings; rawData = data?.getNextEarnings;
epsRatio = ((rawData?.epsEst / rawData?.epsPrior - 1) * 100)?.toFixed(2); epsRatio =
rawData?.epsPrior !== 0
? ((rawData?.epsEst / rawData?.epsPrior - 1) * 100)?.toFixed(2)
: null;
revenueRatio = ( revenueRatio = (
(rawData?.revenueEst / rawData?.revenuePrior - 1) * (rawData?.revenueEst / rawData?.revenuePrior - 1) *
100 100
@ -72,8 +76,9 @@
? "before:content-['+'] text-[#00FC50]" ? "before:content-['+'] text-[#00FC50]"
: 'text-[#FF2F1F]'} ">{abbreviateNumber(revenueRatio)}%</span : 'text-[#FF2F1F]'} ">{abbreviateNumber(revenueRatio)}%</span
> >
YoY {revenueRatio > 0 ? "growth" : revenueRatio < 0 ? "shrinking" : ""} and YoY {revenueRatio > 0 ? "growth" : revenueRatio < 0 ? "shrinking" : ""}
earnings per share of {#if epsRatio !== null}
and earnings per share of
<span class="font-semibold">{rawData?.epsEst}</span>, making a <span class="font-semibold">{rawData?.epsEst}</span>, making a
<span <span
class="{epsRatio > 0 class="{epsRatio > 0
@ -81,6 +86,10 @@
: 'text-[#FF2F1F]'} ">{epsRatio}%</span : 'text-[#FF2F1F]'} ">{epsRatio}%</span
> >
{epsRatio > 0 ? "increase" : epsRatio < 0 ? "decrease" : ""} YoY. {epsRatio > 0 ? "increase" : epsRatio < 0 ? "decrease" : ""} YoY.
{:else}
and earnings per share of
<span class="font-semibold">{rawData?.epsEst}</span>.
{/if}
</div> </div>
</div> </div>
</div> </div>

View File

@ -548,7 +548,7 @@
? item?.epsEst?.toFixed(2) ? item?.epsEst?.toFixed(2)
: "-"} : "-"}
</span> </span>
{#if item?.epsEst !== null && item?.epsPrior !== null} {#if item?.epsEst !== null && item?.epsPrior !== null && item?.epsPrior !== 0}
{#if item?.epsEst / item?.epsPrior - 1 >= 0} {#if item?.epsEst / item?.epsPrior - 1 >= 0}
<span class="ml-1 text-[#22C55E]"> <span class="ml-1 text-[#22C55E]">
+{( +{(