bugfixing ratios page
This commit is contained in:
parent
d2585382e6
commit
9517b0fdf9
@ -143,7 +143,7 @@ export function sumQuarterlyResultsByYear(quarterlyResults, namingList) {
|
|||||||
|
|
||||||
// Define a Set of keys to exclude from summing
|
// Define a Set of keys to exclude from summing
|
||||||
//FMP sucks since these keys are up to date for every quarter hence no summation required
|
//FMP sucks since these keys are up to date for every quarter hence no summation required
|
||||||
const excludeKeys = new Set(['weightedAverageShsOut', 'weightedAverageShsOutDil']);
|
const excludeKeys = new Set(['priceToEarnings','weightedAverageShsOut', 'weightedAverageShsOutDil']);
|
||||||
|
|
||||||
// Function to get the quarter number from the period string
|
// Function to get the quarter number from the period string
|
||||||
function getQuarterNumber(period) {
|
function getQuarterNumber(period) {
|
||||||
|
|||||||
@ -351,7 +351,6 @@ const exportData = (format = 'csv') => {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -314,7 +314,7 @@ $: {
|
|||||||
if (timeFrame || displayStatement || filterRule)
|
if (timeFrame || displayStatement || filterRule)
|
||||||
{
|
{
|
||||||
if (filterRule === 'annual') {
|
if (filterRule === 'annual') {
|
||||||
fullStatement = sumQuarterlyResultsByYear(data?.getRatiosStatement)
|
fullStatement = sumQuarterlyResultsByYear(data?.getRatiosStatement, namingList)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
fullStatement = data?.getRatiosStatement;
|
fullStatement = data?.getRatiosStatement;
|
||||||
@ -334,7 +334,6 @@ $: {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
@ -512,44 +511,58 @@ $: {
|
|||||||
<tr class="text-white odd:bg-[#27272A] whitespace-nowrap">
|
<tr class="text-white odd:bg-[#27272A] whitespace-nowrap">
|
||||||
<td class="text-start border-r border-[#191E24] text-xs sm:text-sm">PE Ratio</td>
|
<td class="text-start border-r border-[#191E24] text-xs sm:text-sm">PE Ratio</td>
|
||||||
{#each ratios as item}
|
{#each ratios as item}
|
||||||
<td class="text-xs sm:text-sm"> {item?.priceEarningsRatio?.toFixed(2)}</td>
|
<td class="text-xs sm:text-sm">
|
||||||
|
{filterRule === 'annual' ? (item?.priceEarningsRatio/4)?.toFixed(2): item?.priceEarningsRatio?.toFixed(2)}
|
||||||
|
</td>
|
||||||
{/each}
|
{/each}
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="text-white odd:bg-[#27272A]">
|
<tr class="text-white odd:bg-[#27272A]">
|
||||||
<td class="text-start border-r border-[#191E24] text-xs sm:text-sm">PS Ratio</td>
|
<td class="text-start border-r border-[#191E24] text-xs sm:text-sm">PS Ratio</td>
|
||||||
{#each ratios as item}
|
{#each ratios as item}
|
||||||
<td class="text-xs sm:text-sm"> {item?.priceToSalesRatio?.toFixed(2)}</td>
|
<td class="text-xs sm:text-sm">
|
||||||
|
{filterRule === 'annual' ? (item?.priceToSalesRatio/4)?.toFixed(2): item?.priceToSalesRatio?.toFixed(2)}
|
||||||
|
</td>
|
||||||
{/each}
|
{/each}
|
||||||
</tr>
|
</tr>
|
||||||
<!-- row -->
|
<!-- row -->
|
||||||
<tr class="text-white odd:bg-[#27272A]">
|
<tr class="text-white odd:bg-[#27272A]">
|
||||||
<td class="text-start border-r border-[#191E24] text-xs sm:text-sm">PB Ratio</td>
|
<td class="text-start border-r border-[#191E24] text-xs sm:text-sm">PB Ratio</td>
|
||||||
{#each ratios as item}
|
{#each ratios as item}
|
||||||
<td class="text-xs sm:text-sm"> {item?.priceToBookRatio?.toFixed(2)}</td>
|
<td class="text-xs sm:text-sm">
|
||||||
|
{filterRule === 'annual' ? (item?.priceToBookRatio/4)?.toFixed(2): item?.priceToBookRatio?.toFixed(2)}
|
||||||
|
</td>
|
||||||
{/each}
|
{/each}
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="text-white odd:bg-[#27272A] whitespace-nowrap">
|
<tr class="text-white odd:bg-[#27272A] whitespace-nowrap">
|
||||||
<td class="text-start border-r border-[#191E24] text-xs sm:text-sm">P/FCF Ratio</td>
|
<td class="text-start border-r border-[#191E24] text-xs sm:text-sm">P/FCF Ratio</td>
|
||||||
{#each ratios as item}
|
{#each ratios as item}
|
||||||
<td class="text-xs sm:text-sm"> {item?.priceToFreeCashFlowsRatio?.toFixed(2)}</td>
|
<td class="text-xs sm:text-sm">
|
||||||
|
{filterRule === 'annual' ? (item?.priceToFreeCashFlowsRatio/4)?.toFixed(2): item?.priceToFreeCashFlowsRatio?.toFixed(2)}
|
||||||
|
</td>
|
||||||
{/each}
|
{/each}
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="text-white odd:bg-[#27272A]">
|
<tr class="text-white odd:bg-[#27272A]">
|
||||||
<td class="text-start border-r border-[#191E24] text-xs sm:text-sm">P/OCF Ratio</td>
|
<td class="text-start border-r border-[#191E24] text-xs sm:text-sm">P/OCF Ratio</td>
|
||||||
{#each ratios as item}
|
{#each ratios as item}
|
||||||
<td class="text-xs sm:text-sm"> {item?.priceToOperatingCashFlowsRatio?.toFixed(2)}</td>
|
<td class="text-xs sm:text-sm">
|
||||||
|
{filterRule === 'annual' ? (item?.priceToOperatingCashFlowsRatio/4)?.toFixed(2): item?.priceToOperatingCashFlowsRatio?.toFixed(2)}
|
||||||
|
</td>
|
||||||
{/each}
|
{/each}
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="text-white odd:bg-[#27272A]">
|
<tr class="text-white odd:bg-[#27272A]">
|
||||||
<td class="text-start border-r border-[#191E24] text-xs sm:text-sm">OCF/S Ratio</td>
|
<td class="text-start border-r border-[#191E24] text-xs sm:text-sm">OCF/S Ratio</td>
|
||||||
{#each ratios as item}
|
{#each ratios as item}
|
||||||
<td class="text-xs sm:text-sm"> {item?.operatingCashFlowSalesRatio !== null ? item?.operatingCashFlowSalesRatio?.toFixed(2) : '-'}</td>
|
<td class="text-xs sm:text-sm">
|
||||||
|
{filterRule === 'annual' ? (item?.operatingCashFlowSalesRatio/4)?.toFixed(2): item?.operatingCashFlowSalesRatio?.toFixed(2)}
|
||||||
|
</td>
|
||||||
{/each}
|
{/each}
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="text-white odd:bg-[#27272A]">
|
<tr class="text-white odd:bg-[#27272A]">
|
||||||
<td class="text-start border-r border-[#191E24] text-xs sm:text-sm">Debt / Equity Ratio</td>
|
<td class="text-start border-r border-[#191E24] text-xs sm:text-sm">Debt / Equity Ratio</td>
|
||||||
{#each ratios as item}
|
{#each ratios as item}
|
||||||
<td class="text-xs sm:text-sm"> {item?.debtEquityRatio?.toFixed(2)}</td>
|
<td class="text-xs sm:text-sm">
|
||||||
|
{filterRule === 'annual' ? (item?.debtEquityRatio/4)?.toFixed(2): item?.debtEquityRatio?.toFixed(2)}
|
||||||
|
</td>
|
||||||
{/each}
|
{/each}
|
||||||
</tr>
|
</tr>
|
||||||
<!-- row -->
|
<!-- row -->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user