Changeset 10683
- Timestamp:
- May 24, 2010, 4:17:49 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/qt/utils.cc
r10682 r10683 78 78 else if( (int)ratio == TR_RATIO_INF ) 79 79 buf = QString::fromUtf8( "\xE2\x88\x9E" ); 80 else if( ratio < 10.0 )81 buf.sprintf( "%'.2f", ratio );82 else if( ratio < 100.0 )83 buf.sprintf( "%'.1f", ratio );84 80 else 85 buf.sprintf( "%'.0f", ratio ); 81 { 82 QStringList temp; 83 84 temp = QString().sprintf( "%f", ratio ).split( "." ); 85 if( ratio < 100.0 ) 86 { 87 if( ratio < 10.0 ) 88 temp[1].truncate( 2 ); 89 else 90 temp[1].truncate( 1 ); 91 buf = temp.join( "." ); 92 } 93 else 94 buf = QString( temp[0] ); 95 } 86 96 87 97 return buf;
Note: See TracChangeset
for help on using the changeset viewer.