feat: simple currency string formatting to prevent long float inaccuracies displaying
This commit is contained in:
parent
f69530c68a
commit
269a961eed
|
@ -9,7 +9,7 @@
|
||||||
class="spare-time flex flex-row items-center font-bold rounded-2xl select-none"
|
class="spare-time flex flex-row items-center font-bold rounded-2xl select-none"
|
||||||
:class="`text-${$store.getters.activeTab.darkColor}`"
|
: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
|
<span
|
||||||
class="fas fa-hourglass-half text-xl pt-1 pl-2 md:text-3xl md:pt-2"
|
class="fas fa-hourglass-half text-xl pt-1 pl-2 md:text-3xl md:pt-2"
|
||||||
/>
|
/>
|
||||||
|
@ -18,6 +18,19 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</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>
|
<style scoped>
|
||||||
.key-art {
|
.key-art {
|
||||||
background: url('https://freesvg.org/img/johnny_automatic_hourglass.png');
|
background: url('https://freesvg.org/img/johnny_automatic_hourglass.png');
|
||||||
|
|
Reference in New Issue