From 80b4c03800325543458086a72adb2c0f001c9c05 Mon Sep 17 00:00:00 2001 From: Valentin Kaelin Date: Mon, 16 Dec 2019 21:15:10 +0100 Subject: [PATCH] feat: use kilo notation when displaying the stats --- client/src/components/Match/DetailedMatchTeam.vue | 11 +++++++---- client/src/components/Match/Match.vue | 4 ++-- client/src/main.js | 4 ++++ 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/client/src/components/Match/DetailedMatchTeam.vue b/client/src/components/Match/DetailedMatchTeam.vue index dcb97ba..f3b17ff 100644 --- a/client/src/components/Match/DetailedMatchTeam.vue +++ b/client/src/components/Match/DetailedMatchTeam.vue @@ -174,19 +174,19 @@ {{ player[statsFormat].gold }} + >{{ roundStats(player[statsFormat].gold) }} {{ player[statsFormat].dmgChamp }} + >{{ roundStats(player[statsFormat].dmgChamp) }} {{ player[statsFormat].dmgObj }} + >{{ roundStats(player[statsFormat].dmgObj) }} {{ player[statsFormat].dmgTaken }} + >{{ roundStats(player[statsFormat].dmgTaken) }}
Gold -
{{ data.stats.gold }}
+
{{ data.stats.gold|kilo }}
Damage -
{{ data.stats.dmgChamp }}
+
{{ data.stats.dmgChamp|kilo }}
KillParticipation diff --git a/client/src/main.js b/client/src/main.js index 08d0315..6b04997 100644 --- a/client/src/main.js +++ b/client/src/main.js @@ -14,6 +14,10 @@ Vue.filter('capitalize', (value) => { return value.charAt(0).toUpperCase() + value.slice(1).toLowerCase() }) +Vue.filter('kilo', (value) => { + return `${+(value / 1000).toFixed(1)}k` +}) + Vue.filter('secToTime', (sec) => { const min = Math.floor(sec / 60) const newSec = sec - min * 60