From 9e9ca20239e1c823d00e590b7ccbbe105437db6a Mon Sep 17 00:00:00 2001 From: aaronp64 Date: Wed, 3 Dec 2025 16:25:44 -0500 Subject: [PATCH] Round ProgressBar percentage instead of truncating Updated to round before converting ratio to int, to make percentage display more accurate --- scene/gui/progress_bar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/gui/progress_bar.cpp b/scene/gui/progress_bar.cpp index fcab27e73e8..a72aaee53b6 100644 --- a/scene/gui/progress_bar.cpp +++ b/scene/gui/progress_bar.cpp @@ -165,7 +165,7 @@ void ProgressBar::_notification(int p_what) { ratio = CLAMP(percentage, is_lesser_allowed() ? percentage : 0, is_greater_allowed() ? percentage : 1); } - String txt = itos(int(ratio * 100)); + String txt = itos(int(Math::round(ratio * 100))); if (is_localizing_numeral_system()) { const String &lang = _get_locale();