ppy / osu

rhythm is just a *click* away!
https://osu.ppy.sh
MIT License
15.51k stars 2.3k forks source link

Use consistent decimal places in BeatmapAttributeText #30802

Closed cloudrac3r closed 5 days ago

cloudrac3r commented 5 days ago

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.

smoogipoo commented 5 days ago

Tests need adjustments here.

bdach commented 5 days ago

Have fixed the tests.

Two things to @cloudrac3r:

cloudrac3r commented 5 days ago

Username OpenSauce04 is not my account, so it's strange that you saw that error. I've taken your advice for next time. Thank you for fixing the tests!