Page MenuHomeWildfire Games

Limit gather rate tooltip to 2 decimal places
ClosedPublic

Authored by Angen on Jan 23 2021, 8:12 PM.

Details

Reviewers
wraitii
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Commits
rP24782: Limit gather rate tooltip to 2 decimal places
Summary

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.

Test Plan

agree or opose

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Angen created this revision.Jan 23 2021, 8:12 PM
Owners added a subscriber: Restricted Owners Package.Jan 23 2021, 8:12 PM
Angen published this revision for review.Jan 23 2021, 8:12 PM

Build is green

builderr-debug-macos.txt
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libnetwork_dbg.a(precompiled.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libtinygettext_dbg.a(precompiled.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libtinygettext_dbg.a(tinygettext.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/liblobby_dbg.a(precompiled.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libglooxwrapper_dbg.a(precompiled.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file

See https://jenkins.wildfiregames.com/job/macos-differential/3030/display/redirect for more details.

Why 2 and not 1?

Why 2 and not 1?

I would agree that 2 is important. Our gather rates are mostly in the 0.5-1 range, and the 2 decimals are important.

Alternatively we could show gather rates per minute, and then not show decimals at all.

Two is fine for me, I was merely asking ;)

wraitii accepted this revision.Jan 24 2021, 8:51 AM

This writes 1 as 1.00 but I think it's actually OK for readability because all numbers use the same decimals.

This revision is now accepted and ready to land.Jan 24 2021, 8:51 AM

We should have a function for max decimals I guess.

yes we should but I was lazy to start that, see attached comments in https://code.wildfiregames.com/D2053

This revision was automatically updated to reflect the committed changes.