diff --git a/src/routes/stocks/[tickerID]/statistics/employees/+page.svelte b/src/routes/stocks/[tickerID]/statistics/employees/+page.svelte
index a0937c25..3fa9cd1a 100644
--- a/src/routes/stocks/[tickerID]/statistics/employees/+page.svelte
+++ b/src/routes/stocks/[tickerID]/statistics/employees/+page.svelte
@@ -665,14 +665,14 @@
historyList[index + 1]?.employeeCount,
)}
{:else}
- -
+ n/a
{/if}
{#if index + 1 - historyList?.length === 0}
- -
+ n/a
{:else if item?.employeeCount - historyList[index + 1]?.employeeCount > 0}
+{(
@@ -692,7 +692,7 @@
)?.toFixed(2)}%
{:else}
- -
+ n/a
{/if}
|
diff --git a/src/routes/stocks/[tickerID]/statistics/market-cap/+layout.svelte b/src/routes/stocks/[tickerID]/statistics/market-cap/+layout.svelte
index c8316b73..df16eb94 100644
--- a/src/routes/stocks/[tickerID]/statistics/market-cap/+layout.svelte
+++ b/src/routes/stocks/[tickerID]/statistics/market-cap/+layout.svelte
@@ -4,6 +4,71 @@
export let data;
const similarStocks = data?.getSimilarStocks;
+
+ function getMarketCapCategory(marketCap) {
+ const BILLION = 1_000_000_000;
+ const MILLION = 1_000_000;
+
+ const marketCapNavigation = [
+ {
+ threshold: 200 * BILLION,
+ name: "Mega-Cap",
+ link: "/list/market-cap/mega-cap-stocks",
+ },
+ {
+ minThreshold: 10 * BILLION,
+ maxThreshold: 200 * BILLION,
+ name: "Large-Cap",
+ link: "/list/market-cap/large-cap-stocks",
+ },
+ {
+ minThreshold: 2 * BILLION,
+ maxThreshold: 10 * BILLION,
+ name: "Mid-Cap",
+ link: "/list/market-cap/mid-cap-stocks",
+ },
+ {
+ minThreshold: 300 * MILLION,
+ maxThreshold: 2 * BILLION,
+ name: "Small-Cap",
+ link: "/list/market-cap/small-cap-stocks",
+ },
+ {
+ minThreshold: 50 * MILLION,
+ maxThreshold: 300 * MILLION,
+ name: "Micro-Cap",
+ link: "/list/market-cap/micro-cap-stocks",
+ },
+ {
+ maxThreshold: 50 * MILLION,
+ name: "Nano-Cap",
+ link: "/list/market-cap/nano-cap-stocks",
+ },
+ ];
+
+ if (!marketCap) return null;
+
+ // Convert string to number if needed
+ const capValue =
+ typeof marketCap === "string" ? parseFloat(marketCap) : marketCap;
+
+ return marketCapNavigation.find((category) => {
+ if (category.threshold) {
+ return capValue >= category.threshold;
+ }
+ if (category.minThreshold && category.maxThreshold) {
+ return (
+ capValue >= category.minThreshold && capValue < category.maxThreshold
+ );
+ }
+ if (category.maxThreshold) {
+ return capValue < category.maxThreshold;
+ }
+ return false;
+ });
+ }
+
+ let capCategory = getMarketCapCategory(data?.getStockQuote?.marketCap);
@@ -57,24 +122,36 @@
>
- {#each similarStocks?.slice(0, 8) as item}
- {#if item?.marketCap > 0}
- | {item?.symbol} |
- {abbreviateNumber(item?.marketCap)} |
-
+ {#each similarStocks?.slice(0, 8) as item, index}
+ {#if item?.marketCap > 0}
+ | {item?.symbol} |
+ {abbreviateNumber(item?.marketCap)} |
+
{/if}
{/each}
+ {#if capCategory}
+
+ {capCategory?.name} Rankings
+
+ {/if}
{/if}
diff --git a/src/routes/stocks/[tickerID]/statistics/market-cap/+page.svelte b/src/routes/stocks/[tickerID]/statistics/market-cap/+page.svelte
index 4f1f5f06..a272bdf4 100644
--- a/src/routes/stocks/[tickerID]/statistics/market-cap/+page.svelte
+++ b/src/routes/stocks/[tickerID]/statistics/market-cap/+page.svelte
@@ -25,10 +25,19 @@
let rawData = data?.getHistoricalMarketCap || [];
let tableList = [];
- let filterRule = "annual";
let changePercentageYearAgo = 0;
let timePeriod = "3Y";
+ const tabs = [
+ {
+ title: "Annual",
+ },
+ {
+ title: "Quarterly",
+ },
+ ];
+ let activeIdx = 0;
+
function getMarketCapCategory(marketCap) {
const BILLION = 1_000_000_000;
const MILLION = 1_000_000;
@@ -36,36 +45,36 @@
const marketCapNavigation = [
{
threshold: 200 * BILLION,
- name: "Mega Cap",
+ name: "Mega-Cap",
link: "/list/market-cap/mega-cap-stocks",
},
{
minThreshold: 10 * BILLION,
maxThreshold: 200 * BILLION,
- name: "Large Cap",
+ name: "Large-Cap",
link: "/list/market-cap/large-cap-stocks",
},
{
minThreshold: 2 * BILLION,
maxThreshold: 10 * BILLION,
- name: "Mid Cap",
+ name: "Mid-Cap",
link: "/list/market-cap/mid-cap-stocks",
},
{
minThreshold: 300 * MILLION,
maxThreshold: 2 * BILLION,
- name: "Small Cap",
+ name: "Small-Cap",
link: "/list/market-cap/small-cap-stocks",
},
{
minThreshold: 50 * MILLION,
maxThreshold: 300 * MILLION,
- name: "Micro Cap",
+ name: "Micro-Cap",
link: "/list/market-cap/micro-cap-stocks",
},
{
maxThreshold: 50 * MILLION,
- name: "Nano Cap",
+ name: "Nano-Cap",
link: "/list/market-cap/nano-cap-stocks",
},
];
@@ -181,9 +190,9 @@
return quarterlyData;
}
- function changeTablePeriod(state: string) {
- filterRule = state;
- if (state === "annual") {
+ function changeTablePeriod(index) {
+ activeIdx = index;
+ if (activeIdx === 0) {
tableList = filterEndOfYearDates(rawData);
} else {
tableList = filterEndOfQuarterDates(rawData);
@@ -390,7 +399,9 @@
/>
-
+
-
- -
-
-
- -
- {#if data?.user?.tier === "Pro"}
-
- {:else}
-
- Quarterly
-
+ {#each tabs as item, i}
+ {#if data?.user?.tier !== "Pro" && i > 0}
+
- {/if}
-
-
+
+ {item.title}
+
+
+
+ {:else}
+
+ {/if}
+ {/each}
+
+