1
0
Fork 0
mirror of https://github.com/thepaperpilot/Advent-Incremental.git synced 2025-03-31 13:01:02 +00:00

Apply flooring to resource displays

This commit is contained in:
Seth Posner 2022-12-01 15:29:13 -08:00
parent 338f83545f
commit 1e0bf4b5bf

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);
} }