Format isk
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
export const iskFormater = new Intl.NumberFormat("is-IS", {
|
||||
style: "currency",
|
||||
currency: "ISK",
|
||||
const iskFormater = new Intl.NumberFormat("is-IS", {
|
||||
minimumFractionDigits: 2,
|
||||
});
|
||||
|
||||
export const formatIsk = (value: number | bigint) => iskFormater.format(value) + " ISK";
|
||||
|
||||
export const percentFormater = new Intl.NumberFormat("en-US", {
|
||||
style: "percent",
|
||||
minimumFractionDigits: 0
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { iskFormater, percentFormater } from '@/formaters';
|
||||
import { formatIsk, percentFormater } from '@/formaters';
|
||||
import { useStorage } from '@vueuse/core';
|
||||
import { computed } from 'vue';
|
||||
import BuySellSlider from './BuySellSlider.vue';
|
||||
@@ -49,8 +49,8 @@ const copyToClipboard = (s: string) => navigator.clipboard.writeText(s);
|
||||
<tbody>
|
||||
<tr v-for="r in computedResult" :key="r.typeID" class="cursor-pointer" :class="{'bg-emerald-500': (useSellOrder ? r.sell_ratio : r.buy_ratio) >= threshold / 100 }" @click="copyToClipboard(r.name)">
|
||||
<td>{{ r.name }}</td>
|
||||
<td class="text-right">{{ iskFormater.format(useSellOrder ? r.sell : r.buy) }}</td>
|
||||
<td class="text-right">{{ iskFormater.format(useSellOrder ? r.sell_reprocess : r.buy_reprocess) }}</td>
|
||||
<td class="text-right">{{ formatIsk(useSellOrder ? r.sell : r.buy) }}</td>
|
||||
<td class="text-right">{{ formatIsk(useSellOrder ? r.sell_reprocess : r.buy_reprocess) }}</td>
|
||||
<td class="text-right">{{ percentFormater.format(useSellOrder ? r.sell_ratio : r.buy_ratio) }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user