From 0dd50d1bbe8e0c6727d44feb6bb3b6f8ff1ed3c6 Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Sat, 9 Nov 2024 22:20:28 +0100 Subject: [PATCH] ui fix --- .../stocks/[tickerID]/dividends/+layout.svelte | 3 ++- .../[tickerID]/statistics/employees/+layout.svelte | 14 ++++++++++---- .../statistics/market-cap/+layout.svelte | 2 ++ 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/routes/stocks/[tickerID]/dividends/+layout.svelte b/src/routes/stocks/[tickerID]/dividends/+layout.svelte index 6a5b1726..3034cd9e 100644 --- a/src/routes/stocks/[tickerID]/dividends/+layout.svelte +++ b/src/routes/stocks/[tickerID]/dividends/+layout.svelte @@ -69,7 +69,8 @@ > {item?.dividendYield !== null + >{item?.dividendYield !== null && + item?.dividendYield !== undefined ? item?.dividendYield + "%" : "n/a"} diff --git a/src/routes/stocks/[tickerID]/statistics/employees/+layout.svelte b/src/routes/stocks/[tickerID]/statistics/employees/+layout.svelte index b731b721..c0da0556 100644 --- a/src/routes/stocks/[tickerID]/statistics/employees/+layout.svelte +++ b/src/routes/stocks/[tickerID]/statistics/employees/+layout.svelte @@ -67,10 +67,16 @@ > {parseFloat(item?.employees).toLocaleString("en-US", { - maximumFractionDigits: 2, - minimumFractionDigits: 0, - })}{item?.employees !== null && + item?.employees !== undefined + ? parseFloat(item?.employees).toLocaleString( + "en-US", + { + maximumFractionDigits: 2, + minimumFractionDigits: 0, + }, + ) + : "n/a"} {/each} diff --git a/src/routes/stocks/[tickerID]/statistics/market-cap/+layout.svelte b/src/routes/stocks/[tickerID]/statistics/market-cap/+layout.svelte index 58e2c756..c8316b73 100644 --- a/src/routes/stocks/[tickerID]/statistics/market-cap/+layout.svelte +++ b/src/routes/stocks/[tickerID]/statistics/market-cap/+layout.svelte @@ -58,6 +58,7 @@ > {#each similarStocks?.slice(0, 8) as item} + {#if item?.marketCap > 0} {abbreviateNumber(item?.marketCap)} + {/if} {/each}