small fix
This commit is contained in:
parent
c6b93a1d73
commit
9bbba4b427
@ -97,21 +97,23 @@
|
|||||||
|
|
||||||
// Calculate percentage change if baseClose and currentDataRow are valid
|
// Calculate percentage change if baseClose and currentDataRow are valid
|
||||||
const closeValue =
|
const closeValue =
|
||||||
$realtimePrice !== null
|
$realtimePrice !== null && $realtimePrice !== undefined
|
||||||
? $realtimePrice
|
? $realtimePrice
|
||||||
: (currentDataRowOneDay?.close ?? currentDataRowOneDay?.value);
|
: (currentDataRowOneDay?.close ?? currentDataRowOneDay?.value);
|
||||||
|
|
||||||
const graphCloseValue =
|
const graphCloseValue =
|
||||||
$realtimePrice !== null
|
$realtimePrice !== null && $realtimePrice !== undefined
|
||||||
? $realtimePrice
|
? $realtimePrice
|
||||||
: (currentDataRow?.close ?? currentDataRow?.value);
|
: (currentDataRow?.close ?? currentDataRow?.value);
|
||||||
|
|
||||||
if (closeValue && baseClose) {
|
if (closeValue && baseClose) {
|
||||||
change = ((closeValue / baseClose - 1) * 100).toFixed(2);
|
change = ((closeValue / baseClose - 1) * 100)?.toFixed(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (graphCloseValue && graphBaseClose) {
|
if (graphCloseValue && graphBaseClose) {
|
||||||
graphChange = ((graphCloseValue / graphBaseClose - 1) * 100).toFixed(2);
|
graphChange = ((graphCloseValue / graphBaseClose - 1) * 100)?.toFixed(
|
||||||
|
2,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Format date
|
// Format date
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user