From e8e2b5bd0aa10d5f87d08e9d2a886d8a07ec1540 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Thu, 14 Mar 2024 19:12:52 +0200 Subject: [PATCH] okular: do not look for and remove "0" in the zoom text obviously not very locale aware (non-arabic digits?) Signed-off-by: Ivailo Monev --- okular/ui/pageview.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/okular/ui/pageview.cpp b/okular/ui/pageview.cpp index d70e3bec..84d93057 100644 --- a/okular/ui/pageview.cpp +++ b/okular/ui/pageview.cpp @@ -3622,7 +3622,6 @@ void PageView::updateZoomText() translated << i18n("Fit Width") << i18n("Fit Page") << i18n("Auto Fit"); // add percent items - const QString single_oh( "0" ); int idx = 0, selIdx = 3; bool inserted = false; //use: "d->zoomMode != ZoomFixed" to hide Fit/* zoom ratio int zoomValueCount = 11; @@ -3637,14 +3636,7 @@ void PageView::updateZoomText() inserted = true; if ( !inserted ) selIdx++; - // we do not need to display 2-digit precision - QString localValue( KGlobal::locale()->formatNumber( value * 100.0, 1 ) ); - const QChar decimalPoint = KGlobal::locale()->toLocale().decimalPoint(); - localValue.remove( decimalPoint + single_oh ); - // remove a trailing zero in numbers like 66.70 - if ( localValue.right( 1 ) == QLatin1String( "0" ) && localValue.indexOf( decimalPoint ) > -1 ) - localValue.chop( 1 ); - translated << QString( "%1%" ).arg( localValue ); + translated << QString( "%1%" ).arg( KGlobal::locale()->formatNumber( qFloor(value * 100.0), 0 ) ); } d->aZoom->setItems( translated );