From 73b9dd2fb696bf7cfa6050efca8513ddc8c5da1d Mon Sep 17 00:00:00 2001 From: Bobo Date: Fri, 12 Jul 2024 09:32:15 +0200 Subject: [PATCH 1/2] Initial logic with dummy data --- src/components/dashboard/Inflation.vue | 12 +- .../dashboard/InflationRateChart.vue | 17 ++- src/hooks/useInflation.ts | 117 ++++++++++++------ .../implementations/SubscanRepository.ts | 2 +- 4 files changed, 100 insertions(+), 48 deletions(-) diff --git a/src/components/dashboard/Inflation.vue b/src/components/dashboard/Inflation.vue index 1e1a134fe..963724f21 100644 --- a/src/components/dashboard/Inflation.vue +++ b/src/components/dashboard/Inflation.vue @@ -88,12 +88,12 @@ export default defineComponent({ const numberFromPercentage = (value?: number): number | string => value !== undefined ? value * 100 : '--'; - const adjustableStakersPercentage = computed(() => - Number( - ( - realizedAdjustableStakersPart.value / inflationParameters.value.adjustableStakersPart - ).toFixed(3) - ) + const adjustableStakersPercentage = computed( + () => + Math.round( + (realizedAdjustableStakersPart.value / inflationParameters.value.adjustableStakersPart) * + 100 + ) / 100 ); watch( diff --git a/src/components/dashboard/InflationRateChart.vue b/src/components/dashboard/InflationRateChart.vue index 79c855e0f..64c411dda 100644 --- a/src/components/dashboard/InflationRateChart.vue +++ b/src/components/dashboard/InflationRateChart.vue @@ -22,7 +22,7 @@