From dd0f3adc791606bfc3609459408fc744710c0dc5 Mon Sep 17 00:00:00 2001 From: Kseninia Mikhaylova Date: Thu, 25 Apr 2024 15:17:27 +0300 Subject: [PATCH] format --- front/src/App.vue | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/front/src/App.vue b/front/src/App.vue index ca4cacb..22f0cdc 100644 --- a/front/src/App.vue +++ b/front/src/App.vue @@ -17,13 +17,16 @@ const item = computed(() => { return null } }) -const getData = async ()=>{ +const getData = async () => { const res = await fetch(`${baseUrl}/api/sheet`) const result = await res.json() if (result.status == "success") { data.value = result.data } } +const formatNumber = (n: string) => { + return Math.ceil(parseFloat(n.replace(',', '.'))) +} onMounted(async () => { await getData() setInterval(async () => { @@ -42,11 +45,11 @@ onMounted(async () => {
{{ item.name.slice(0, 2).join(' ') }}
- {{ item.hours }} / {{ Math.ceil(parseFloat(item.calendar)) }} + {{ formatNumber(item.hours) }} / {{ formatNumber(item.calendar) }} ({{ item.percent }}%) + 'high': parseInt(item.percent) >= 70, + 'medium': parseInt(item.percent) >= 35 && parseInt(item.percent) < 70, + }">({{ formatNumber(item.percent) }}%)
\ No newline at end of file