2022-10-15 20:15:55 +00:00
|
|
|
<template>
|
|
|
|
{{ value }}
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
2022-12-30 01:19:15 +00:00
|
|
|
type Props = {
|
|
|
|
amount: string | number;
|
|
|
|
};
|
|
|
|
|
|
|
|
const props = defineProps<Props>();
|
2022-10-15 20:15:55 +00:00
|
|
|
|
|
|
|
const fmt = await useFormatCurrency();
|
|
|
|
|
|
|
|
const value = computed(() => {
|
|
|
|
if (!props.amount || props.amount === "0") {
|
2022-12-30 01:19:15 +00:00
|
|
|
return fmt(0);
|
2022-10-15 20:15:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return fmt(props.amount);
|
|
|
|
});
|
|
|
|
</script>
|