Abbreviating counts in filters.

This commit is contained in:
DebaucheryLibrarian 2024-03-28 01:28:41 +01:00
parent f13b6e1a03
commit 82cd0ac057
5 changed files with 16 additions and 7 deletions

View File

@ -36,14 +36,17 @@
<span
v-if="actor.count"
:title="actor.count"
class="filter-count"
>{{ actor.count }}</span>
>{{ abbreviateNumber(actor.count) }}</span>
</span>
</span>
</li>
</template>
<script setup>
import abbreviateNumber from '#/src/utils/abbreviate-number.js';
import Gender from '#/components/actors/gender.vue';
defineProps({

View File

@ -63,8 +63,9 @@
<span class="filter-details">
<span
v-if="entity.count"
:title="entity.count"
class="filter-count"
>{{ entity.count }}</span>
>{{ abbreviateNumber(entity.count) }}</span>
<Icon
v-if="filters.entity?.id === entity.id"
@ -83,6 +84,8 @@
<script setup>
import { ref, computed, inject } from 'vue';
import abbreviateNumber from '#/src/utils/abbreviate-number.js';
const props = defineProps({
filters: {
type: Object,

View File

@ -86,8 +86,9 @@
<span class="tag-details">
<span
v-if="tag.count"
:title="tag.count"
class="filter-count"
>{{ tag.count }}</span>
>{{ abbreviateNumber(tag.count) }}</span>
</span>
</span>
</li>
@ -99,6 +100,8 @@
<script setup>
import { ref, computed, inject } from 'vue';
import abbreviateNumber from '#/src/utils/abbreviate-number.js';
const props = defineProps({
filters: {
type: Object,

View File

@ -126,6 +126,7 @@
import { ref, inject } from 'vue';
import { del, patch } from '#/src/api.js';
import abbreviateNumber from '#/src/utils/abbreviate-number.js';
import Dialog from '#/components/dialog/dialog.vue';
@ -150,10 +151,6 @@ const stashNameInput = ref(null);
const showRenameDialog = ref(false);
const done = ref(true);
function abbreviateNumber(number) {
return number?.toLocaleString('en-US', { notation: 'compact' }) || 0;
}
async function setPublic(isPublic) {
if (done.value === false) {
return;

View File

@ -0,0 +1,3 @@
export default function abbreviateNumber(number) {
return number?.toLocaleString('en-US', { notation: 'compact' }) || 0;
}