1
0
forked from 0ad/0ad

Limit gather rate tooltip to 2 decimal places

Gather rates are not rounded, so after some modifiers are applied, they
appear as ugly decimal numbers.
Limiting them into 2 decimal places for readability and it looks nicer.

Differential revision: D3460
Reviewed by: @wraitii
This was SVN commit r24782.
This commit is contained in:
Angen 2021-01-24 15:28:13 +00:00
parent 5b367ac37e
commit 04a7d95eff

View File

@ -728,7 +728,7 @@ function getGatherTooltip(template)
Object.keys(rates).map(
type => sprintf(translate("%(resourceIcon)s %(rate)s"), {
"resourceIcon": resourceIcon(type),
"rate": rates[type]
"rate": rates[type].toFixed(2)
})
).join(" ")
});