Use consistent decimal places in BeatmapAttributeText #30802
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, BeatmapAttributeText will always display 2 decimal places, possibly with trailing zeroes, for attributes that normally don't have trailing zeroes.
In most of the game, and on web, difficulty attributes are displayed with one decimal place, but can be displayed as whole numbers if there are no decimals e.g. (CS 3.8, HP 5.5, Accuracy 9, AR 9.2) for https://osu.ppy.sh/beatmapsets/1314891#osu/2725039. If mods are applied, difficulty attributes will be displayed with up to 2 decimal places. This can be seen by turning on DT then looking at the top left section of lazer song select. So I have changed the difficulty attribute format to
0.##
.The same logic applies for BPM. Usually it's displayed as a whole number, but it can have up to 2 decimal places if necessary: https://osu.ppy.sh/beatmapsets/2268670#fruits/4831566. So I changed this format to
0.##
as well.I have not changed the display of star rating because it's always 2 decimal places with trailing zeroes: https://osu.ppy.sh/beatmapsets/2253429#osu/4794131
I tested this manually and it seems to work. I'm not sure if there's any automated tests that need to be updated.