ui fix
This commit is contained in:
parent
33edefa9bd
commit
a4f621d5ec
@ -353,6 +353,11 @@ export function formatString(inputString) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function abbreviateNumber(number, addDollarSign = false) {
|
export function abbreviateNumber(number, addDollarSign = false) {
|
||||||
|
// Check if number is null or undefined, return "-" if true
|
||||||
|
if (number == null) {
|
||||||
|
return "-";
|
||||||
|
}
|
||||||
|
|
||||||
const negative = number < 0;
|
const negative = number < 0;
|
||||||
|
|
||||||
// Handle special case for exactly 1000
|
// Handle special case for exactly 1000
|
||||||
@ -362,8 +367,8 @@ export function abbreviateNumber(number, addDollarSign = false) {
|
|||||||
? "-$1K"
|
? "-$1K"
|
||||||
: "$1K"
|
: "$1K"
|
||||||
: negative
|
: negative
|
||||||
? "-1K"
|
? "-1K"
|
||||||
: "1K";
|
: "1K";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Math.abs(number) !== 0 && Math.abs(number) > 1000) {
|
if (Math.abs(number) !== 0 && Math.abs(number) > 1000) {
|
||||||
|
|||||||
@ -108,6 +108,8 @@
|
|||||||
name: "PE Ratio",
|
name: "PE Ratio",
|
||||||
data: valueList,
|
data: valueList,
|
||||||
type: "line",
|
type: "line",
|
||||||
|
areaStyle: { opacity: 0.2 },
|
||||||
|
smooth: true,
|
||||||
symbol: "none",
|
symbol: "none",
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
color: "#fff",
|
color: "#fff",
|
||||||
@ -293,7 +295,7 @@
|
|||||||
<td
|
<td
|
||||||
class="text-sm sm:text-[1rem] whitespace-nowrap {item?.changesPercentage !==
|
class="text-sm sm:text-[1rem] whitespace-nowrap {item?.changesPercentage !==
|
||||||
null && item?.changesPercentage >= 0
|
null && item?.changesPercentage >= 0
|
||||||
? 'text-[#00FC50]'
|
? "before:content-['+'] text-[#00FC50]"
|
||||||
: item?.changesPercentage < 0
|
: item?.changesPercentage < 0
|
||||||
? 'text-[#FF2F1F]'
|
? 'text-[#FF2F1F]'
|
||||||
: 'text-white'} text-end"
|
: 'text-white'} text-end"
|
||||||
|
|||||||
@ -207,8 +207,11 @@
|
|||||||
class="mb-4 px-0.5 text-white xs:text-[1.05rem] lg:leading-normal"
|
class="mb-4 px-0.5 text-white xs:text-[1.05rem] lg:leading-normal"
|
||||||
>
|
>
|
||||||
The PE ratio is {rawData?.priceEarningsRatio} and the forward PE
|
The PE ratio is {rawData?.priceEarningsRatio} and the forward PE
|
||||||
ratio is {rawData?.forwardPE}. {companyName}'s PEG ratio is
|
ratio is {rawData?.forwardPE}.
|
||||||
{rawData?.peg}.
|
{rawData?.peg !== null
|
||||||
|
? `${companyName}'s PEG ratio is
|
||||||
|
${rawData?.peg}.`
|
||||||
|
: ""}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<table class="w-full">
|
<table class="w-full">
|
||||||
@ -267,7 +270,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td
|
<td
|
||||||
class="px-[5px] py-1.5 text-right font-semibold xs:px-2.5 xs:py-2"
|
class="px-[5px] py-1.5 text-right font-semibold xs:px-2.5 xs:py-2"
|
||||||
>{rawData?.peg}</td
|
>{rawData?.peg !== null ? rawData?.peg : "n/a"}</td
|
||||||
>
|
>
|
||||||
</tr></tbody
|
</tr></tbody
|
||||||
>
|
>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user