Skip to content

[TF2] Add thousands separators to various values #1330

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

horiuchii
Copy link

Description

This PR adds thousands separators to various values across the game that tend to become very large and difficult to read at first glance without separators, this previously only existed on the player list stats on the MvM scoreboard.

I moved and renamed ConvertScoreboardValueToString inside of tf_hud_mann_vs_machine_scoreboard.cpp to V_AddThousandSeparators inside of strtools.cpp to make it a more accessible function, this was to avoid using V_pretifynum as it's around 4x slower and results in the same desired output.

The thousands separator applies to the following values:

  • Strange item counts
  • All stats displayed on scoreboards
  • PVP Panel stats (Casual XP, Comp MMR and unused MYM matchmaking stats)
  • Competitive match history stats
  • MvM Currency (Counts near the player health and the upgrade menu and upgrade cost)

Examples:

@gidi30
Copy link

gidi30 commented Jun 3, 2025

Sounds great but it might be good to add some way to localize this since certain languages use . as the thousands seperator and , as the decimal seperator

@gaelcoral
Copy link

gaelcoral commented Jun 3, 2025

Sounds great but it might be good to add some way to localize this since certain languages use . as the thousands seperator and , as the decimal seperator

In Spanish both for Latin America and Spain, four-digit numbers do not use a period or comma as a separator. For five digits or more, a space is used as the thousands separator (ideally a non-breaking space).

So, if this pull request were to be implemented, the values should be implemented as localized strings with format variables, so localizers can properly apply the correct number formatting for their language (like Deadlock).
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants