[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-i18n-de
Subject:    Tester gesucht: Kalzium Lokalisierung
From:       Stephan Johach <lucardus () onlinehome ! de>
Date:       2007-03-21 17:32:21
Message-ID: 200703211832.21907.lucardus () onlinehome ! de
[Download RAW message or body]

Hallo zusammen!

Nachdem uns bei der Übersetzung auffiel, dass Kalzium die
lokalisierten Zahlenformate nicht berücksichtigt, habe ich 
einen Patch implementiert, der freundlicherweise bereits 
von Burkhard getestet wurde.

Es wäre mir ganz lieb, wenn noch der eine oder andere
einen Blick darauf werfen könnte, bevor das im stable
branch landet.

Ihr müsst allerdings die Sourcen patchen und kompilieren.

Gruß,
Stephan

["bug122760-2.patch" (text/x-diff)]

Index: src/detailedgraphicaloverview.cpp
===================================================================
--- src/detailedgraphicaloverview.cpp	(Revision 642543)
+++ src/detailedgraphicaloverview.cpp	(Arbeitskopie)
@@ -87,6 +87,8 @@
 		QFont fB = KGlobalSettings::generalFont();
 		QFont fC = KGlobalSettings::generalFont();
 
+		QString strLocalizedMass = KalziumUtils::localizedValue( m_element->mass(), 6 );
+
 		fA.setPointSize( fA.pointSize() + 20 ); //Huge font
 		fA.setBold( true );
 		fB.setPointSize( fB.pointSize() + 6 ); //Big font
@@ -117,7 +119,7 @@
 				
 		int size = KalziumUtils::maxSize(m_element->elname(), rect , fC, &p);
 		int size2 = KalziumUtils::maxSize(m_element->oxstage(), rect, fC, &p);
-		int size3 = KalziumUtils::maxSize(QString::number( m_element->mass() ), rect , fC, \
&p); +		int size3 = KalziumUtils::maxSize( strLocalizedMass , rect , fC, &p);
 
 		//Name and other data
 		fC.setPointSize( size );
@@ -129,14 +131,15 @@
 		//Oxidationstates
 		fC.setPointSize( size2 );
 		p.setFont( fC );
-		int offsetOx = KalziumUtils::StringHeight( QString::number( m_element->mass() ), \
fC, &p ); +		int offsetOx = KalziumUtils::StringHeight( strLocalizedMass , fC, &p );
 		p.drawText( 1, h-offsetOx, w/2, offsetOx, Qt::AlignLeft, m_element->oxstage() );
 
 		//Mass
 		fC.setPointSize( size3 );
 		p.setFont( fC );
-		int offset = KalziumUtils::StringHeight( QString::number( m_element->mass() ), fC, \
                &p );
-		p.drawText( w/2, h-offset, w/2, offset, Qt::AlignRight, QString::number( \
m_element->mass() ) ); +		
+		int offset = KalziumUtils::StringHeight( strLocalizedMass, fC, &p );
+		p.drawText( w/2, h-offset, w/2, offset, Qt::AlignRight, strLocalizedMass );
 
 		drawBiologicalSymbol( &p );
 	}
Index: src/kalziumtip.cpp
===================================================================
--- src/kalziumtip.cpp	(Revision 642543)
+++ src/kalziumtip.cpp	(Arbeitskopie)
@@ -21,6 +21,7 @@
  ***************************************************************************/
 
 #include "kalziumtip.h"
+#include "kalziumutils.h"
 #include "element.h"
 
 #include <qapplication.h>
@@ -130,7 +131,7 @@
 			.arg( QString::number(m_tippedElement->number()) );
 	
 	QString mass = i18n( "Mass: %1" )
-			.arg( QString::number(m_tippedElement->mass()) );
+			.arg( KalziumUtils::localizedValue(m_tippedElement->mass(), 6) );
 
 	m_richText = new QSimpleRichText("<qt><h1>" + elementname + "</h1><p>"
 						    + number + "</p><p>"
Index: src/spectrumwidget.cpp
===================================================================
--- src/spectrumwidget.cpp	(Revision 642543)
+++ src/spectrumwidget.cpp	(Arbeitskopie)
@@ -24,6 +24,7 @@
 #include "kalziumutils.h"
 
 #include <kdebug.h>
+#include <kglobal.h>
 #include <klocale.h>
 #include <math.h>
 
@@ -249,7 +250,7 @@
 			{
 				pos = ( double ) ( i*d )/width();
 				p->fillRect( i*d-space, m_realHeight+12, 2*space, 15, Qt::white );
-				p->drawText( i*d-space, m_realHeight+12, 2*space, 15, Qt::AlignCenter, \
QString::number( KalziumUtils::strippedValue( Wavelength( pos ) ) ) ); \
+				p->drawText( i*d-space, m_realHeight+12, 2*space, 15, Qt::AlignCenter, \
KalziumUtils::localizedValue(  KalziumUtils::strippedValue( Wavelength( pos ) ), 6 ) \
);  }
 		}
 		else {//small tickmarks
Index: src/isotope.cpp
===================================================================
--- src/isotope.cpp	(Revision 642543)
+++ src/isotope.cpp	(Arbeitskopie)
@@ -18,6 +18,7 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.          *
  ***************************************************************************/
 #include "isotope.h"
+#include "kalziumutils.h"
 
 #include <kdebug.h>
 #include <klocale.h>
@@ -51,24 +52,24 @@
 	if ( !seconds() )//years
 	{
 		if ( m_halflife > 1000000 )
-			halflife = i18n("%1 million years").arg( m_halflife/1000000.0 );
+			halflife = i18n("%1 million years").arg( KalziumUtils::localizedValue( \
m_halflife/1000000.0, 2 ) );  if ( m_halflife > 1000000000 )
-			halflife = i18n("%1 billion years").arg( m_halflife/1000000000.0 );
+			halflife = i18n("%1 billion years").arg( KalziumUtils::localizedValue( \
m_halflife/1000000000.0, 2 ) );  else
-			halflife = i18n("%1 years").arg( m_halflife );
+			halflife = i18n("%1 years").arg( KalziumUtils::localizedValue( m_halflife, 2 ) );
 	}
 	else
 	{
 		if ( m_halflife < 120 )
-			halflife = i18n("%1 seconds").arg( m_halflife );
+			halflife = i18n("%1 seconds").arg( KalziumUtils::localizedValue( m_halflife, 2 ) \
);  else if ( m_halflife > 1000 )
-			halflife = i18n("%1 minutes").arg( m_halflife/60.0 );
+			halflife = i18n("%1 minutes").arg( KalziumUtils::localizedValue( m_halflife/60.0, \
2 ) );  else if ( m_halflife > 3600 )
-			halflife = i18n("%1 hours").arg( m_halflife/( 60*60 ) );
+			halflife = i18n("%1 hours").arg( KalziumUtils::localizedValue( m_halflife/( 60*60 \
), 2 ) );  if ( m_halflife > 86400 )   //one day
-			halflife = i18n("%1 days").arg( m_halflife/( 60*60*24 ) );
+			halflife = i18n("%1 days").arg( KalziumUtils::localizedValue( m_halflife/( \
60*60*24 ), 2 ) );  if ( m_halflife > ( 31536000 * 2 ) ) //two year
-			halflife = i18n("%1 years").arg( m_halflife/( 3600.0*365 ));
+			halflife = i18n("%1 years").arg( KalziumUtils::localizedValue( m_halflife/( \
3600.0*365 ), 2 ) );  }
 
 	return halflife;
Index: src/kalziumutils.h
===================================================================
--- src/kalziumutils.h	(Revision 642543)
+++ src/kalziumutils.h	(Arbeitskopie)
@@ -22,6 +22,10 @@
 class KalziumUtils
 {
 	public:
+
+		enum FormatOptions { NoOptions,
+				     Round = 1
+				   };	
 		/**
 		 * @param string the string which is measured
 		 * @param rect the rect needed for measurement
@@ -41,6 +45,36 @@
 		static double strippedValue( double value );
 
 		/**
+		 * format the given number string with localized separators
+		 * @param string the number value as unlocalized string
+		 * @param precision number of decimals, default is 2
+		 * @param options the options used for formatting of @p string
+		 * @return
+		 */
+		static QString localizedValue( const QString& string, int precision, unsigned long \
options = 0 ); +
+		/**
+		 * format the given double with localized separators
+		 * @param val the number value as double
+		 * @param precision number of decimals, default is 2
+		 * @param options the options used for formatting of @p val
+		 * @return
+		 */
+		static QString localizedValue( double val, int precision, unsigned long options = \
0   ); +
+		/**
+		 * format the given int with localized separators
+		 * @param val the number value as int
+		 * @return
+		 */
+		static QString localizedValue( int val );
+
+		/**
+		 * 	
+		 */
+		static QString formatLocalizedValue( const QString& string, int precision, \
unsigned long options ); +
+		/**
 		 * @param string the string which is measured
 		 * @param font the used font
 		 * @param painter the used painter
Index: src/detailinfodlg.cpp
===================================================================
--- src/detailinfodlg.cpp	(Revision 642543)
+++ src/detailinfodlg.cpp	(Arbeitskopie)
@@ -15,6 +15,7 @@
 
 #include "detailinfodlg.h"
 #include "isotope.h"
+#include "kalziumutils.h"
 #include "kalziumdataobject.h"
 
 #include <kdebug.h>
@@ -175,12 +176,12 @@
 			
 			if ( m_element->abundance() > 0 ){
 			html.append( "<tr><td><img src=\"abundance.png\" alt=\"icon\"/></td><td>" );
-			html.append( i18n( "Abundance in crustal rocks: %1 ppm" ).arg( \
m_element->abundance() ) ); +			html.append( i18n( "Abundance in crustal rocks: %1 \
ppm" ).arg( KalziumUtils::localizedValue( m_element->abundance() ) ) );  html.append( \
"</td></tr>" );  }
 			
 			html.append( "<tr><td><img src=\"mass.png\" alt=\"icon\"/></td><td>" );
-			html.append( i18n( "Mean mass: %1 u" ).arg( QString::number( \
m_element->meanmass() ) ) ); +			html.append( i18n( "Mean mass: %1 u" ).arg( \
KalziumUtils::localizedValue( m_element->meanmass(), 6 ) ) );  html.append( \
"</td></tr>" );  if ( !m_element->nameOrigin().isEmpty() )
 			{
@@ -263,60 +264,62 @@
 	{
 		html.append( "<tr><td align=\"right\">" );
 		if ( ( *it )->weight() > 0.0 )
-			html.append( i18n( "%1 u" ).arg( ( *it )->weight() ) );
+			html.append( i18n( "%1 u" ).arg( KalziumUtils::localizedValue( ( *it )->weight(), \
6 ) ) );  //	html.append( i18n( "%1 u" ).arg( QString::number( ( *it )->weight() ) \
));  html.append( "</td><td>" );
 		html.append( QString::number( ( *it )->neutrons() ) );
 		html.append( "</td><td>" );
 		if ( ( *it )->percentage() > 0.0 )
-			html.append( i18n( "this can for example be '24%'", "%1%" ).arg( ( *it \
)->percentage() ) ); +			html.append( i18n( "this can for example be '24%'", "%1%" \
).arg( KalziumUtils::localizedValue( ( *it )->percentage(), 6 ) ) );  html.append( \
                "</td><td>" );
-		if ( ( *it )->halflife() > 0.0 )
-			html.append( ( *it )->halflifeAsString() );
+		if ( ( *it )->halflife() > 0.0 ) {
+			html.append( ( *it )->halflifeAsString()  );
+		}
 		html.append( "</td><td>" );
 		if ( ( *it )->alphapercentage() > 0.0 ){
 			if ( ( *it )->alphadecay() > 0.0 )
-			html.append( i18n( "%1 MeV" ).arg(( *it )->alphadecay() ) );
+			html.append( i18n( "%1 MeV" ).arg( KalziumUtils::localizedValue( ( *it \
)->alphadecay(), 6 ) ) );  html.append( i18n( " %1" ).arg( QChar( 945 ) ) );
 			if ( ( *it )->alphapercentage() < 100.0)
-				html.append( i18n( "(%1%)" ).arg(( *it )->alphapercentage() ));
+				html.append( i18n( "(%1%)" ).arg( KalziumUtils::localizedValue( (*it \
)->alphapercentage(), 6 ) ) );  if ( ( *it )->betaminuspercentage() > 0.0 || ( *it \
)->betapluspercentage() > 0.0 || ( *it )->ecpercentage() > 0.0)  html.append( i18n( \
", " ) );  }
 		if ( ( *it )->betaminuspercentage() > 0.0 ){
 			if ( ( *it )->betaminusdecay() > 0.0 )
-				html.append( i18n( "%1 MeV" ).arg(( *it )->betaminusdecay() ) );
+				html.append( i18n( "%1 MeV" ).arg( KalziumUtils::localizedValue( ( *it \
)->betaminusdecay(), 6 ) ) );  html.append( i18n( " %1<sup>-</sup>" ).arg( QChar( 946 \
) ) );  if ( ( *it )->betaminuspercentage() < 100.0)
-				html.append( i18n( "(%1%)" ).arg(( *it )->betaminuspercentage() ));
+				html.append( i18n( "(%1%)" ).arg( KalziumUtils::localizedValue( ( *it \
)->betaminuspercentage(), 6 ) ));  if ( ( *it )->betapluspercentage() > 0.0 || ( *it \
)->ecpercentage() > 0.0 )  html.append( i18n( ", " ) );
 			}
 		if ( ( *it )->betapluspercentage() > 0.0 ){
 			if ( ( *it )->betaplusdecay() > 0.0 )
-				html.append( i18n( "%1 MeV" ).arg(( *it )->betaplusdecay() ) );
+				html.append( i18n( "%1 MeV" ).arg( KalziumUtils::localizedValue( ( *it \
)->betaplusdecay(), 6 ) ) );  html.append( i18n( " %1<sup>+</sup>" ).arg(QChar( 946 ) \
) );  if ( ( *it )->betapluspercentage() == ( *it )->ecpercentage() ) {
 				if ( ( *it )->ecdecay() > 0.0 ) {
-				html.append( i18n( "%1 MeV" ).arg(( *it )->ecdecay() ) ); }
+					html.append( i18n( "%1 MeV" ).arg( KalziumUtils::localizedValue( ( *it \
)->ecdecay(), 6 ) ) );  +				}
 				html.append( i18n( "Acronym of Electron Capture"," EC" ) ); 
 			}
 			if ( ( *it )->betapluspercentage() < 100.0)	
-				html.append( i18n( "(%1%)" ).arg(( *it )->betapluspercentage() )); 
+				html.append( i18n( "(%1%)" ).arg( KalziumUtils::localizedValue( ( *it \
)->betapluspercentage(), 6 ) ) );   html += " ";
 			}	
 		if ( ( *it )->ecpercentage() > 0.0 && ( *it )->ecpercentage()!=( *it \
)->betapluspercentage()){  if ( ( *it )->ecdecay() > 0.0 )
-				html.append( i18n( "%1 MeV" ).arg(( *it )->ecdecay() ) );
+				html.append( i18n( "%1 MeV" ).arg( KalziumUtils::localizedValue( ( *it \
)->ecdecay(), 6 ) ) );  html.append( i18n( "Acronym of Electron Capture"," EC" ) );
 			if ( ( *it )->ecpercentage() < 100.0 )
-				html.append( i18n( "(%1%)" ).arg(( *it )->ecpercentage() ));
+				html.append( i18n( "(%1%)" ).arg( KalziumUtils::localizedValue( ( *it \
)->ecpercentage(), 6 ) ) );  }
 		html.append( "</td><td>" );
 		html.append( ( *it )->spin() );
 		html.append( "</td><td>" );
 		if ( !( *it )->magmoment().isEmpty() )
-			html.append( i18n( "%1 %2<sub>n</sub>" ).arg( ( *it )->magmoment() ).arg( QChar( \
956 ) ) ); +			html.append( i18n( "%1 %2<sub>n</sub>" ).arg( \
KalziumUtils::localizedValue( ( *it )->magmoment(), 6 ) ).arg( QChar( 956 ) ) );  \
html.append( "</td></tr>" );  
 	}
Index: src/kalzium.cpp
===================================================================
--- src/kalzium.cpp	(Revision 642543)
+++ src/kalzium.cpp	(Arbeitskopie)
@@ -29,6 +29,7 @@
 #include "timewidget_impl.h"
 #include "somwidget_impl.h"
 #include "kalziumdataobject.h"
+#include "kalziumutils.h"
 #include "config.h"
 
 #include <qdockwindow.h>
@@ -421,7 +422,7 @@
 void Kalzium::slotStatusbar( int num )
 {
 	Element *e = KalziumDataObject::instance()->element( num );
-	statusBar()->changeItem( i18n( "For example: \"Carbon (6), Mass: 12.0107 u\"", "%1 \
(%2), Mass: %3 u" ).arg( e->elname() ).arg(e->number() ).arg( e->mass() ) , \
IDS_ELEMENTINFO ); +	statusBar()->changeItem( i18n( "For example: \"Carbon (6), Mass: \
12.0107 u\"", "%1 (%2), Mass: %3 u" ).arg( e->elname() ).arg(e->number() ).arg( \
KalziumUtils::localizedValue( e->mass(), 6 ) ) , IDS_ELEMENTINFO );  }
 
 void Kalzium::openInformationDialog( int number )
Index: src/element.cpp
===================================================================
--- src/element.cpp	(Revision 642543)
+++ src/element.cpp	(Arbeitskopie)
@@ -106,7 +106,7 @@
 	if ( val <= 0 )
 		v = i18n( "Value unknown" );
 	else
-		v = i18n( "%1 is a length, eg: 12.3 pm", "%1 pm" ).arg( QString::number( val ) );
+		v = i18n( "%1 is a length, eg: 12.3 pm", "%1 pm" ).arg( \
KalziumUtils::localizedValue( val, 6 ) );  return v;
 }
 
@@ -119,11 +119,13 @@
 		{
 			value*=96.6;
 			v = QString::number( value );
+			v = KalziumUtils::localizedValue( v, 6 );
 			v.append( " kJ/mol" );
 		}
 		else // use electronvolt
 		{
 			v = QString::number( value );
+			v = KalziumUtils::localizedValue( v, 6 );
 			v.append( " eV" );
 		}
 	}
@@ -148,21 +150,22 @@
 		else
 		{
 			double newvalue = TempUnit::convert( val, (int)TempUnit::Kelvin, \
Prefs::temperature() ); +			QString strVal = KalziumUtils::localizedValue( newvalue, \
6 );  switch (Prefs::temperature()) {
 				case 0: //Kelvin
-					v = i18n( "%1 is the temperature in Kelvin", "%1 K" ).arg( newvalue );
+					v = i18n( "%1 is the temperature in Kelvin", "%1 K" ).arg( strVal );
 					break;
 				case 1://Kelvin to Celsius
-					v = i18n( "%1 is the temperature in Celsius", "%1 %2C" ).arg( newvalue ).arg( \
QChar(0xB0) ); +					v = i18n( "%1 is the temperature in Celsius", "%1 %2C" ).arg( \
strVal ).arg( QChar(0xB0) );  break;
 				case 2: // Kelvin to Fahrenheit
-					v = i18n( "%1 is the temperature in Fahrenheit", "%1 %2F" ).arg( newvalue \
).arg( QChar(0xB0) ); +					v = i18n( "%1 is the temperature in Fahrenheit", "%1 %2F" \
).arg( strVal ).arg( QChar(0xB0) );  break;
 				case 3: // Kelvin to Rankine
-					v = i18n( "%1 is the temperature in Rankine", "%1 %2Ra" ).arg( newvalue ).arg( \
QChar(0xB0) ); +					v = i18n( "%1 is the temperature in Rankine", "%1 %2Ra" ).arg( \
strVal ).arg( QChar(0xB0) );  break;
 				case 4: // Kelvin to Reaumur
-					v = i18n( "%1 is the temperature in Reaumur", "%1 %2R" ).arg( newvalue ).arg( \
QChar(0xB0) ); +					v = i18n( "%1 is the temperature in Reaumur", "%1 %2R" ).arg( \
strVal ).arg( QChar(0xB0) );  break;
 			}
 		}
@@ -171,9 +174,10 @@
 	{
 		val = electroneg();
 		if ( val <= 0 )
-		v = i18n( "Value not defined" );
-		else
-			v = QString::number( val );
+			v = i18n( "Value not defined" );
+		else {
+			v = KalziumUtils::localizedValue( val, 6 );
+		}
 	}
 	else if ( type == EA ) //Electron affinity
 	{
@@ -184,12 +188,12 @@
 		{
 			if ( Prefs::energies() == 0 )
 			{
-				v = i18n( "%1 kJ/mol" ).arg( QString::number( val ) );
+				v = i18n( "%1 kJ/mol" ).arg( KalziumUtils::localizedValue( val, 6 ) );
 			}
 			else // use electronvolt
 			{
 				val/=96.6;
-				v = i18n( "%1 eV" ).arg( QString::number( val ) );
+				v = i18n( "%1 eV" ).arg( KalziumUtils::localizedValue( val, 6 ) );
 			}
 		}
 	}
@@ -199,7 +203,7 @@
 		if ( val <= 0 )
 			v = i18n( "Value unknown" );
 		else
-			v = i18n( "%1 u" ).arg( QString::number( val ) );
+			v = i18n( "%1 u" ).arg( KalziumUtils::localizedValue( val, 6 ) );
 	}
 	else if ( type == DENSITY ) // its a density
 	{
@@ -211,11 +215,11 @@
 		{
 			if ( boiling() < 295.0 && melting() < 295.0)//gasoline
 			{
-				v = i18n( "%1 g/L" ).arg( QString::number( val ) );
+				v = i18n( "%1 g/L" ).arg( KalziumUtils::localizedValue( val, 6 ) );
 			}
 			else//liquid or solid
 			{
-				v = i18n( "%1 g/cm<sup>3</sup>" ).arg( QString::number( val ) );
+				v = i18n( "%1 g/cm<sup>3</sup>" ).arg( KalziumUtils::localizedValue( val, 6 ));
 			}
 		}
 	}
@@ -263,6 +267,7 @@
 	//top left
 	p->setPen( Qt::black );
 	text = QString::number( KalziumUtils::strippedValue( mass( ) ) );
+	text = KalziumUtils::localizedValue( text, 6 );
 	p->drawText( X,Y ,ELEMENTSIZE,h_small,Qt::AlignCenter, text );
 
 	text = QString::number( number() );
@@ -334,7 +339,7 @@
 	f.setPointSize( KalziumUtils::maxSize(value, QRect( X,Y+ELEMENTSIZE-h_small, \
ELEMENTSIZE, h_small ),f, p ) );  p->setFont( f );
 
-	p->drawText( X,Y+ELEMENTSIZE-h_small , ELEMENTSIZE, h_small,Qt::AlignCenter, value \
); +	p->drawText( X,Y+ELEMENTSIZE-h_small , ELEMENTSIZE, h_small,Qt::AlignCenter, \
KalziumUtils::localizedValue( value, 6 ) );  
 	const QRect rect = QRect( X,Y,ELEMENTSIZE-2,ELEMENTSIZE-10 );
 	int goodsize = KalziumUtils::maxSize( symbol(), rect, symbol_font, p );
@@ -438,7 +443,7 @@
 				text = i18n( "Crystalsystem cubic close packed", "ccp" );
 		}
 		else
-			text = QString::number( KalziumUtils::strippedValue( mass( ) ) );
+			text = KalziumUtils::localizedValue( KalziumUtils::strippedValue( mass( ) ), 6 );
 		p->drawText( X+2,Y ,ELEMENTSIZE-4 ,h_small,Qt::AlignCenter, text );
 	}
 	
Index: src/kalziumutils.cpp
===================================================================
--- src/kalziumutils.cpp	(Revision 642543)
+++ src/kalziumutils.cpp	(Arbeitskopie)
@@ -13,6 +13,8 @@
 #include "kalziumutils.h"
 
 #include <kdebug.h>
+#include <kglobal.h>
+#include <klocale.h>
 #include <qfont.h>
 #include <qrect.h>
 #include <qpainter.h>
@@ -72,3 +74,32 @@
 	return num * power / 10000;
 }
 	
+QString KalziumUtils::localizedValue( const QString& string, int precision, unsigned \
long options  ) +{
+	QString strLocalized = KGlobal::locale()->formatNumber( string, options & \
KalziumUtils::Round ? true : false, precision );  +	return formatLocalizedValue( \
strLocalized, precision, options ); +}
+
+QString KalziumUtils::localizedValue( double val, int precision, unsigned long \
options  ) +{
+	QString strLocalized = KGlobal::locale()->formatNumber( val, precision ); 
+	return formatLocalizedValue( strLocalized, precision, options );
+}
+
+QString KalziumUtils::formatLocalizedValue( const QString& string, int precision, \
unsigned long options ) +{
+	QString str( string );
+	while( str.endsWith("0") )
+		str.truncate( str.length()-1);
+	if ( str.endsWith( KGlobal::locale()->decimalSymbol()  ) )
+	{
+		// we do not want trailing ',' values so readd trailing 0 
+		str.append( '0' ); // 
+	}
+	return str;
+}
+
+QString KalziumUtils::localizedValue( int val )
+{
+	return KGlobal::locale()->formatLong( val );	
+}



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic