mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-02 04:00:36 +00:00
fix(stats): show decimals between 0-1
This commit is contained in:
parent
24b9bd6ccc
commit
832106dc86
1 changed files with 9 additions and 5 deletions
|
|
@ -17,17 +17,17 @@ div
|
|||
.svg-icon(v-html="icons.health")
|
||||
.progress
|
||||
.progress-bar.bg-health(:style="{width: `${percent(member.stats.hp, MAX_HEALTH)}%`}")
|
||||
span.small-text {{member.stats.hp | floor}} / {{MAX_HEALTH}}
|
||||
span.small-text {{member.stats.hp | statFloor}} / {{MAX_HEALTH}}
|
||||
.progress-container.d-flex
|
||||
.svg-icon(v-html="icons.experience")
|
||||
.progress
|
||||
.progress-bar.bg-experience(:style="{width: `${percent(member.stats.exp, toNextLevel)}%`}")
|
||||
span.small-text {{member.stats.exp | floor}} / {{toNextLevel}}
|
||||
span.small-text {{member.stats.exp | statFloor}} / {{toNextLevel}}
|
||||
.progress-container.d-flex(v-if="hasClass")
|
||||
.svg-icon(v-html="icons.mana")
|
||||
.progress
|
||||
.progress-bar.bg-mana(:style="{width: `${percent(member.stats.mp, maxMP)}%`}")
|
||||
span.small-text {{member.stats.mp | floor}} / {{maxMP}}
|
||||
span.small-text {{member.stats.mp | statFloor}} / {{maxMP}}
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
@ -212,8 +212,12 @@ export default {
|
|||
};
|
||||
},
|
||||
filters: {
|
||||
floor (value) {
|
||||
return Math.floor(value);
|
||||
statFloor (value) {
|
||||
if (value < 1 && value > 0) {
|
||||
return Math.ceil(value * 10) / 10;
|
||||
} else {
|
||||
return Math.floor(value);
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
|
|
|||
Loading…
Reference in a new issue