<script setup>
import currency from "currency.js";
import { computed } from "vue";
const props = defineProps({
  modelValue: { type: Number, required: true, default: 0 },
  decimal: { type: Number, required: false, default: 2 },
  currency: { type: String, required: false, default: "" }
});
const formattedCurrency = computed(() => {
  return currency(props.modelValue, {
    pattern: `# !`,
    symbol: props.currency,
    separator: ",",
    precision: props.decimal
  }).format();
});
</script>

<template>
  {{ formattedCurrency }}
</template>
