Apply flooring to resource displays

This commit is contained in:
Seth Posner 2022-12-01 15:29:13 -08:00 committed by thepaperpilot
parent ce895ed0a0
commit 62c3e1f45d

View file

@ -111,7 +111,7 @@ export function trackOOMPS(
export function displayResource(resource: Resource, overrideAmount?: DecimalSource): string { export function displayResource(resource: Resource, overrideAmount?: DecimalSource): string {
const amount = overrideAmount ?? resource.value; const amount = overrideAmount ?? resource.value;
if (Decimal.eq(resource.precision, 0)) { if (Decimal.eq(resource.precision, 0)) {
return formatWhole(amount); return formatWhole(resource.small ? amount : Decimal.floor(amount));
} }
return format(amount, resource.precision, resource.small); return format(amount, resource.precision, resource.small);
} }