This commit is contained in:
Kseninia Mikhaylova 2024-04-25 15:17:27 +03:00
parent dc5c259336
commit dd0f3adc79
1 changed files with 8 additions and 5 deletions

View File

@ -24,6 +24,9 @@ const getData = async ()=>{
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 () => {
<div class="item-wrapper">
<div class="item" v-if="item">
{{ item.name.slice(0, 2).join(' ') }}<br />
{{ item.hours }} / {{ Math.ceil(parseFloat(item.calendar)) }}
{{ formatNumber(item.hours) }} / {{ formatNumber(item.calendar) }}
<strong :class="{
'high': parseInt(item.percent) >= 70,
'medium': parseInt(item.percent) >= 35 && parseInt(item.percent) < 70,
}">({{ item.percent }}%)</strong>
}">({{ formatNumber(item.percent) }}%)</strong>
</div>
</div>
</template>