<script lang="ts">
import { defineComponent } from "vue";

export default defineComponent({
    props: ["value"],
    computed: {
        formattedValue() {
            return Number(this.value).toLocaleString(undefined, {
                minimumFractionDigits: 2,
            });
        }
    }
})

</script>

<template>
    <span class="text-right" :class="value < 0 ? 'negative' : ''">{{formattedValue}} €</span>
</template>