From 91fe03b143c15f34dc0147084faf0163f21e4ef5 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Sun, 11 Sep 2005 14:32:25 +0000 Subject: [PATCH] Forwardport: fix the display of a temperature. BUG: 112412 svn path=/trunk/KDE/kdeedu/kalzium/src/element.cpp; revision=459590 --- kalzium/src/element.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/kalzium/src/element.cpp b/kalzium/src/element.cpp index 8b6d3f2..7a94fc0 100644 --- a/kalzium/src/element.cpp +++ b/kalzium/src/element.cpp @@ -147,23 +147,22 @@ const QString Element::adjustUnits( const int type ) v = i18n( "Value unknown" ); else { - int newvalue = (int)TempUnit::convert( val, Prefs::temperature(), (int)TempUnit::Kelvin ); - QString value = QString::number( newvalue ); + double newvalue = TempUnit::convert( val, (int)TempUnit::Kelvin, Prefs::temperature() ); switch (Prefs::temperature()) { case 0: //Kelvin - v = i18n( "%1 is the temperature in Kelvin", "%1 K" ).arg( QString::number( val ) ); + v = i18n( "%1 is the temperature in Kelvin", "%1 K" ).arg( newvalue ); break; case 1://Kelvin to Celsius - v = i18n( "%1 is the temperature in Celsius", "%1 %2C" ).arg( val ).arg( "\xB0" ); + v = i18n( "%1 is the temperature in Celsius", "%1 %2C" ).arg( newvalue ).arg( "\xB0" ); break; case 2: // Kelvin to Fahrenheit - v = i18n( "%1 is the temperature in Fahrenheit", "%1 %2F" ).arg( val ).arg( "\xB0" ); + v = i18n( "%1 is the temperature in Fahrenheit", "%1 %2F" ).arg( newvalue ).arg( "\xB0" ); break; case 3: // Kelvin to Rankine - v = i18n( "%1 is the temperature in Rankine", "%1 %2Ra" ).arg( val ).arg( "\xB0" ); + v = i18n( "%1 is the temperature in Rankine", "%1 %2Ra" ).arg( newvalue ).arg( "\xB0" ); break; case 4: // Kelvin to Reamur - v = i18n( "%1 is the temperature in Reamur", "%1 %2R" ).arg( val ).arg( "\xB0" ); + v = i18n( "%1 is the temperature in Reamur", "%1 %2R" ).arg( newvalue ).arg( "\xB0" ); break; } } -- 2.47.3