feat: simple currency string formatting to prevent long float inaccuracies displaying

This commit is contained in:
John McCardle 2022-01-11 20:17:11 -05:00 committed by pskfyi
parent f69530c68a
commit 269a961eed
1 changed files with 14 additions and 1 deletions

View File

@ -9,7 +9,7 @@
class="spare-time flex flex-row items-center font-bold rounded-2xl select-none"
:class="`text-${$store.getters.activeTab.darkColor}`"
>
<span class="text-3xl md:text-5xl" v-text="$store.state.currency" />
<span class="text-3xl md:text-5xl" v-text="currencyText" />
<span
class="fas fa-hourglass-half text-xl pt-1 pl-2 md:text-3xl md:pt-2"
/>
@ -18,6 +18,19 @@
</div>
</template>
<script>
export default {
computed: {
currencyText() {
if (this.$store.state.currency.greaterThan(1e7)) {
return this.$store.state.currency.toString()
}
return Math.floor(this.$store.state.currency)
}
}
}
</script>
<style scoped>
.key-art {
background: url('https://freesvg.org/img/johnny_automatic_hourglass.png');