|
{#if item[column.key] === null || item[column.key] === undefined}
n/a
{:else if column.key === "symbol"}
{:else if column.key === "name"}
{#if item[column.key]?.length > charNumber}
{item[column.key]?.slice(0, charNumber) + "..."}
{:else}
{item[column.key]}
{/if}
{:else if column?.type === "int"}
{@html abbreviateNumber(item[column.key], false, true)}
{:else if column?.type === "decimal"}
{item[column.key]?.toLocaleString("en-US")}
{:else if column?.type === "decimalSign"}
{#if item[column.key] >= 0}
+{item[column.key]?.toLocaleString("en-US")}
{:else if item[column.key] < 0}
{item[column.key]?.toLocaleString("en-US")}
{/if}
{:else if column.key === "price"}
{#if item?.previous !== null && item?.previous !== undefined && Math.abs(item?.previous - item[column?.key]) >= 0.01}
{/if}
{item[column.key] !== null
? item[column.key]?.toFixed(2)
: "n/a"}
{:else if column.type === "percent"}
{item[column.key] > 0.01
? item[column.key]?.toFixed(2) + "%"
: "< 0.01%"}
{:else if column.type === "percentSign"}
{#if item[column.key] > 0}
+{item[column.key]?.toFixed(2)}%
{:else if item[column.key] < 0}
{item[column.key]?.toFixed(2)}%
{:else}
{item[column.key]?.toFixed(2)}%
{/if}
{:else if column?.type === "rating"}
{#if ["Strong Buy", "Buy"].includes(item[column.key])}
{item[column.key]}
{:else if ["Strong Sell", "Sell"].includes(item[column.key])}
{item[column.key]}
{:else if item[column.key] === "Hold"}
{item[column.key]}
{:else}
n/a
{/if}
{:else if column.type === "sentiment"}
= 55
? "text-[#00FC50]"
: item[column.key] >= 50
? "text-[#E57C34]"
: "text-[#FF2F1F]"}
>
{item[column.key] >= 80
? "Very Bullish"
: item[column.key] >= 55
? "Bullish"
: item[column.key] > 50
? "Mixed"
: "Bearish"}
{item[column.key]}
{:else}
{item[column.key]}
{/if}
|
{/each}