bugfixing option price

This commit is contained in:
MuslemRahimi 2025-04-14 22:41:45 +02:00
parent 84ed8f433d
commit da76570d08
2 changed files with 18 additions and 3 deletions

View File

@ -62,6 +62,16 @@
description="Stocknear has everything you need to analyze stocks with help of AI, including detailed financial data, statistics, news and charts."
/>
{@html `<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Organization",
"url": "https://stocknear.com",
"name": "Stocknear.com",
"description": "Stocknear has everything you need to analyze stocks with help of AI, including detailed financial data, statistics, news and charts."
}
</script>`}
<div
class="w-full sm:max-w-[1400px] overflow-hidden m-auto min-h-screen bg-white dark:bg-default text-muted dark:text-white mb-16"
>
@ -101,7 +111,7 @@
{#if data?.user}
<Feedback {data} />
{/if}
<!--
<div
class="text-center mb-10 relative w-fit flex justify-center m-auto text-white"
>
@ -122,6 +132,7 @@
>
</div>
</div>
-->
<h1
class="hidden sm:block text-3xl lg:text-4xl text-muted dark:text-white font-bold text-center mb-10 relative w-fit flex justify-center m-auto"

View File

@ -417,7 +417,9 @@
);
const output = await getContractHistory(optionSymbol);
selectedOptionPrice = output?.history?.at(-1)?.mark || 0;
selectedOptionPrice = output?.history?.at(-1)?.mark
? output?.history?.at(-1)?.mark
: output?.history?.at(-1)?.close || 0;
item.optionPrice = selectedOptionPrice;
item.optionSymbol = optionSymbol;
item.optionType = selectedOptionType;
@ -1258,7 +1260,9 @@
</div>
<div class="flex items-baseline">
<span class="text-lg font-semibold"
>${currentStockPrice}</span
>${currentStockPrice
? currentStockPrice?.toFixed(2)
: "n/a"}</span
>
</div>
</div>