From b85f813bede00617775b0f55db6dc417c0db8825 Mon Sep 17 00:00:00 2001 From: Jonathan Bourdon Date: Fri, 6 Mar 2026 11:37:15 -0500 Subject: [PATCH] the silver amount are now ceil to prevent decimals --- src/components/PriceCell.vue | 2 +- src/components/table/ProfitRow.vue | 2 +- src/utils/formatting.ts | 13 +++++++------ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/components/PriceCell.vue b/src/components/PriceCell.vue index 70c9068..2bc1c75 100644 --- a/src/components/PriceCell.vue +++ b/src/components/PriceCell.vue @@ -70,7 +70,7 @@ function startEdit(initial?: number) { } function save() { - const v = Math.round(Number(inputValue.value)) + const v = Math.ceil(Number(inputValue.value)) if (!inputValue.value && inputValue.value !== 0) { clearManualPrice(props.itemId, city.value) } else if (v > 0) { diff --git a/src/components/table/ProfitRow.vue b/src/components/table/ProfitRow.vue index 9677bc9..c637b15 100644 --- a/src/components/table/ProfitRow.vue +++ b/src/components/table/ProfitRow.vue @@ -379,7 +379,7 @@ function startEdit(itemId: string, current: number) { } function saveEdit(itemId: string) { - const v = Math.round(Number(inputValue.value)) + const v = Math.ceil(Number(inputValue.value)) if (!inputValue.value && inputValue.value !== 0) { clearManualPrice(itemId, filters.value.city) } else if (v > 0) { diff --git a/src/utils/formatting.ts b/src/utils/formatting.ts index 2eb688c..b5fef1e 100644 --- a/src/utils/formatting.ts +++ b/src/utils/formatting.ts @@ -244,14 +244,15 @@ export function tierStyle(tier: number): { backgroundColor: string; color: strin } export function formatSilver(value: number): string { - if (value === 0) return '0' - if (Math.abs(value) >= 1_000_000) { - return (value / 1_000_000).toFixed(2) + 'M' + const v = Math.ceil(value) + if (v === 0) return '0' + if (Math.abs(v) >= 1_000_000) { + return (v / 1_000_000).toFixed(2) + 'M' } - if (Math.abs(value) >= 1_000) { - return (value / 1_000).toFixed(1) + 'k' + if (Math.abs(v) >= 1_000) { + return (v / 1_000).toFixed(1) + 'k' } - return value.toLocaleString() + return v.toLocaleString() } export function formatRoi(roi: number): string {