the silver amount are now ceil to prevent decimals

This commit is contained in:
2026-03-06 11:37:15 -05:00
parent 010a92999a
commit b85f813bed
3 changed files with 9 additions and 8 deletions

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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 {