diff --git a/src/reprocess/ReprocessResultTable.vue b/src/reprocess/ReprocessResultTable.vue index e62855e..219157d 100644 --- a/src/reprocess/ReprocessResultTable.vue +++ b/src/reprocess/ReprocessResultTable.vue @@ -12,20 +12,22 @@ const props = withDefaults(defineProps(), { result: () => [] }); -const computedResult = computed(() => props.result.map(r =>({ - ...r, - buy_ratio: (r.buy_reprocess / r.buy) - 1, - sell_ratio: (r.sell_reprocess / r.sell) - 1 -})).sort((a, b) => a.name.localeCompare(b.name))) +const threshold = useStorage('reprocess-threshold', 0); -const threshold = useStorage('reprocess-threshold', 100); +const computedResult = computed(() => { + return props.result.map(r =>({ + ...r, + buy_ratio: r.buy === 0 ? 1 : (r.buy_reprocess / r.buy) - 1, + sell_ratio: r.sell === 0 ? 1 : (r.sell_reprocess / r.sell) - 1 + })).sort((a, b) => a.name.localeCompare(b.name)) +}) @/formaters \ No newline at end of file + \ No newline at end of file