Changeset 10822
- Timestamp:
- Jun 22, 2010, 10:30:58 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/daemon/remote.c
r10818 r10822 113 113 static const double MiB = 1024.0 * 1024.0; 114 114 static const double GiB = 1024.0 * 1024.0 * 1024.0; 115 116 static char* 117 strlpercent( char * buf, double x, size_t buflen ) 118 { 119 return tr_strpercent( buf, x, buflen ); 120 } 115 121 116 122 static char* … … 786 792 && tr_bencDictFindInt( t, "leftUntilDone", &j ) ) 787 793 { 788 strl ratio( buf, 100.0 * ( i - j ),i, sizeof( buf ) );794 strlpercent( buf, 100.0 * ( i - j ) / i, sizeof( buf ) ); 789 795 printf( " Percent Done: %s%%\n", buf ); 790 796 } … … 812 818 { 813 819 j += i - k; 814 printf( " Availability: %.1f%%\n", ( 100 * j ) / (double) i ); 820 strlpercent( buf, 100.0 * j / i, sizeof( buf ) ); 821 printf( " Availability: %s%%\n", buf ); 815 822 } 816 823 if( tr_bencDictFindInt( t, "totalSize", &j ) ) -
trunk/gtk/details.c
r10698 r10822 797 797 str = none; 798 798 else { 799 char unver[64], total[64];799 char buf2[32], unver[64], total[64]; 800 800 const double ratio = 100.0 * ( leftUntilDone ? ( haveValid + haveUnchecked ) / sizeWhenDone : 1 ); 801 tr_strlpercent( buf2, ratio, sizeof( buf2 ) ); 801 802 tr_strlsize( total, haveUnchecked + haveValid, sizeof( total ) ); 802 803 tr_strlsize( unver, haveUnchecked, sizeof( unver ) ); 803 804 if( haveUnchecked ) 804 g_snprintf( buf, sizeof( buf ), _( "%1$s (%2$ .1f%%); %3$s Unverified" ), total, tr_truncd( ratio, 1 ), unver );805 g_snprintf( buf, sizeof( buf ), _( "%1$s (%2$s%%); %3$s Unverified" ), total, buf2, unver ); 805 806 else 806 g_snprintf( buf, sizeof( buf ), _( "%1$s (%2$ .1f%%)" ), total, tr_truncd( ratio, 1 ));807 g_snprintf( buf, sizeof( buf ), _( "%1$s (%2$s%%)" ), total, buf2 ); 807 808 str = buf; 808 809 } … … 814 815 str = none; 815 816 else { 817 char buf2[32]; 816 818 const double d = ( 100.0 * available ) / sizeWhenDone; 817 g_snprintf( buf, sizeof( buf ), _( "%1$.1f%%" ), d ); 819 tr_strlpercent( buf2, d, sizeof( buf2 ) ); 820 g_snprintf( buf, sizeof( buf ), _( "%1$s%%" ), buf2 ); 818 821 str = buf; 819 822 } -
trunk/gtk/torrent-cell-renderer.c
r10505 r10822 50 50 const uint64_t haveTotal = torStat->haveUnchecked + torStat->haveValid; 51 51 const int isSeed = torStat->haveValid >= info->totalSize; 52 char buf1[32], buf2[32], buf3[32], buf4[32], buf5[32] ;52 char buf1[32], buf2[32], buf3[32], buf4[32], buf5[32], buf6[32]; 53 53 char * str; 54 54 double seedRatio; … … 60 60 /* %1$s is how much we've got, 61 61 %2$s is how much we'll have when done, 62 %3$ .2f%% is a percentage of the two */63 _( "%1$s of %2$s (%3$ .2f%%)" ),62 %3$s%% is a percentage of the two */ 63 _( "%1$s of %2$s (%3$s%%)" ), 64 64 tr_strlsize( buf1, haveTotal, sizeof( buf1 ) ), 65 65 tr_strlsize( buf2, torStat->sizeWhenDone, sizeof( buf2 ) ), 66 tr_ truncd( torStat->percentDone * 100.0, 2) );66 tr_strlpercent( buf3, torStat->percentDone * 100.0, sizeof( buf3 ) ) ); 67 67 } 68 68 else if( !isSeed ) /* partial seeds */ … … 73 73 /* %1$s is how much we've got, 74 74 %2$s is the torrent's total size, 75 %3$ .2f%% is a percentage of the two,75 %3$s%% is a percentage of the two, 76 76 %4$s is how much we've uploaded, 77 77 %5$s is our upload-to-download ratio, 78 78 %6$s is the ratio we want to reach before we stop uploading */ 79 _( "%1$s of %2$s (%3$ .2f%%), uploaded %4$s (Ratio: %5$s Goal: %6$s)" ),79 _( "%1$s of %2$s (%3$s%%), uploaded %4$s (Ratio: %5$s Goal: %6$s)" ), 80 80 tr_strlsize( buf1, haveTotal, sizeof( buf1 ) ), 81 81 tr_strlsize( buf2, info->totalSize, sizeof( buf2 ) ), 82 tr_ truncd( torStat->percentComplete * 100.0, 2),83 tr_strlsize( buf 3, torStat->uploadedEver, sizeof( buf3) ),84 tr_strlratio( buf 4, torStat->ratio, sizeof( buf4) ),85 tr_strlratio( buf 5, seedRatio, sizeof( buf5) ) );82 tr_strlpercent( buf3, torStat->percentComplete * 100.0, sizeof( buf3 ) ), 83 tr_strlsize( buf4, torStat->uploadedEver, sizeof( buf4 ) ), 84 tr_strlratio( buf5, torStat->ratio, sizeof( buf5 ) ), 85 tr_strlratio( buf6, seedRatio, sizeof( buf6 ) ) ); 86 86 } 87 87 else … … 90 90 /* %1$s is how much we've got, 91 91 %2$s is the torrent's total size, 92 %3$ .2f%% is a percentage of the two,92 %3$s%% is a percentage of the two, 93 93 %4$s is how much we've uploaded, 94 94 %5$s is our upload-to-download ratio */ 95 _( "%1$s of %2$s (%3$ .2f%%), uploaded %4$s (Ratio: %5$s)" ),95 _( "%1$s of %2$s (%3$s%%), uploaded %4$s (Ratio: %5$s)" ), 96 96 tr_strlsize( buf1, haveTotal, sizeof( buf1 ) ), 97 97 tr_strlsize( buf2, info->totalSize, sizeof( buf2 ) ), 98 tr_ truncd( torStat->percentComplete * 100.0, 2),99 tr_strlsize( buf 3, torStat->uploadedEver, sizeof( buf3) ),100 tr_strlratio( buf 4, torStat->ratio, sizeof( buf4) ) );98 tr_strlpercent( buf3, torStat->percentComplete * 100.0, sizeof( buf3 ) ), 99 tr_strlsize( buf4, torStat->uploadedEver, sizeof( buf4 ) ), 100 tr_strlratio( buf5, torStat->ratio, sizeof( buf5 ) ) ); 101 101 } 102 102 } -
trunk/gtk/util.c
r10818 r10822 104 104 { 105 105 return tr_strratio( buf, buflen, ratio, gtr_get_unicode_string( GTR_UNICODE_INF ) ); 106 } 107 108 char* 109 tr_strlpercent( char * buf, double x, size_t buflen ) 110 { 111 return tr_strpercent( buf, x, buflen ); 106 112 } 107 113 -
trunk/gtk/util.h
r10698 r10822 40 40 const char * gtr_get_unicode_string( int ); 41 41 42 /* return a percent formatted string of either x.xx, xx.x or xxx */ 43 char* tr_strlpercent( char * buf, double x, size_t buflen ); 42 44 43 45 /* return a human-readable string for the size given in bytes. */ -
trunk/libtransmission/utils.c
r10819 r10822 1366 1366 1367 1367 char* 1368 tr_strpercent( char * buf, double x, size_t buflen ) 1369 { 1370 if( x < 10.0 ) 1371 tr_strtruncd( buf, x, 2, buflen ); 1372 else if( x < 100.0 ) 1373 tr_strtruncd( buf, x, 1, buflen ); 1374 else 1375 tr_strtruncd( buf, x, 0, buflen ); 1376 return buf; 1377 } 1378 1379 char* 1368 1380 tr_strratio( char * buf, size_t buflen, double ratio, const char * infinity ) 1369 1381 { … … 1372 1384 else if( (int)ratio == TR_RATIO_INF ) 1373 1385 tr_strlcpy( buf, infinity, buflen ); 1374 else if( ratio < 10.0 )1375 tr_snprintf( buf, buflen, "%.2f", tr_truncd( ratio, 2 ) );1376 else if( ratio < 100.0 )1377 tr_snprintf( buf, buflen, "%.1f", tr_truncd( ratio, 1 ) );1378 1386 else 1379 tr_snprintf( buf, buflen, "%'.0f", ratio ); 1387 tr_strpercent( buf, ratio, buflen ); 1388 return buf; 1389 } 1390 1391 char* 1392 tr_strtruncd( char * buf, double x, int precision, size_t buflen ) 1393 { 1394 tr_snprintf( buf, buflen, "%.*f", precision, tr_truncd( x, precision ) ); 1395 1380 1396 return buf; 1381 1397 } -
trunk/libtransmission/utils.h
r10819 r10822 495 495 double tr_truncd( double x, int decimal_places ); 496 496 497 /* return a percent formatted string of either x.xx, xx.x or xxx */ 498 char* tr_strpercent( char * buf, double x, size_t buflen ); 499 497 500 /** 498 501 * @param buf the buffer to write the string to … … 502 505 */ 503 506 char* tr_strratio( char * buf, size_t buflen, double ratio, const char * infinity ) TR_GNUC_NONNULL(1,4); 507 508 /* return a truncated double as a string */ 509 char* tr_strtruncd( char * buf, double x, int precision, size_t buflen ); 504 510 505 511 /** @brief Portability wrapper for localtime_r() that uses the system implementation if available */ -
trunk/qt/details.cc
r10796 r10822 27 27 #include <QHeaderView> 28 28 #include <QLabel> 29 #include <QLocale>30 29 #include <QPushButton> 31 30 #include <QRadioButton> … … 234 233 Details :: refresh( ) 235 234 { 236 QLocale locale;237 235 const int n = myIds.size( ); 238 236 const bool single = n == 1; … … 311 309 else { 312 310 const double d = 100.0 * ( sizeWhenDone ? ( sizeWhenDone - leftUntilDone ) / sizeWhenDone : 1 ); 313 QString pct = locale.toString( d, 'f', 2);311 QString pct = Utils::percentToString( d ); 314 312 if( !haveUnverified ) 315 313 string = tr( "%1 (%2%)" ) … … 326 324 327 325 // myAvailabilityLabel 328 if( sizeWhenDone < 1 ) 329 string = none; 330 else 331 string.sprintf( "%'.1f%%", ( 100.0 * available ) / sizeWhenDone ); 326 if( torrents.empty( ) ) 327 string = none; 328 else { 329 if( sizeWhenDone == 0 ) 330 string = none; 331 else 332 string = QString( "%1%" ).arg( Utils::percentToString( ( 100.0 * available ) / sizeWhenDone ) ); 333 } 332 334 myAvailabilityLabel->setText( string ); 333 335 … … 860 862 item->setText( COL_UP, peer.rateToPeer.isZero() ? "" : Utils::speedToString( peer.rateToPeer ) ); 861 863 item->setText( COL_DOWN, peer.rateToClient.isZero() ? "" : Utils::speedToString( peer.rateToClient ) ); 862 item->setText( COL_PERCENT, peer.progress > 0 ? QString( "%1%" ).arg( locale.toString((int)(peer.progress*100.0))) : "" );864 item->setText( COL_PERCENT, peer.progress > 0 ? QString( "%1%" ).arg( (int)( peer.progress * 100.0 ) ) : "" ); 863 865 item->setText( COL_STATUS, code ); 864 866 item->setToolTip( COL_STATUS, codeTip ); -
trunk/qt/torrent-delegate.cc
r10779 r10822 75 75 /* %1 is the percentage of torrent metadata downloaded */ 76 76 str = tr( "Magnetized transfer - retrieving metadata (%1%)" ) 77 .arg( tor.metadataPercentDone() * 100.0, 0, 'f', 2);77 .arg( Utils::percentToString( tor.metadataPercentDone() * 100.0 ) ); 78 78 } 79 79 else if( !isDone ) // downloading … … 84 84 str = tr( "%1 of %2 (%3%)" ).arg( Utils::sizeToString( haveTotal ) ) 85 85 .arg( Utils::sizeToString( tor.sizeWhenDone( ) ) ) 86 .arg( tor.percentDone( ) * 100.0, 0, 'f', 2);86 .arg( Utils::percentToString( tor.percentDone( ) * 100.0 ) ); 87 87 } 88 88 else if( !isSeed ) // partial seed … … 99 99 .arg( Utils::sizeToString( haveTotal ) ) 100 100 .arg( Utils::sizeToString( tor.totalSize( ) ) ) 101 .arg( tor.percentComplete( ) * 100.0, 0, 'f', 2)101 .arg( Utils::percentToString( tor.percentComplete( ) * 100.0 ) ) 102 102 .arg( Utils::sizeToString( tor.uploadedEver( ) ) ) 103 103 .arg( Utils::ratioToString( tor.ratio( ) ) ) … … 114 114 .arg( Utils::sizeToString( haveTotal ) ) 115 115 .arg( Utils::sizeToString( tor.totalSize( ) ) ) 116 .arg( tor.percentComplete( ) * 100.0, 0, 'f', 2)116 .arg( Utils::percentToString( tor.percentComplete( ) * 100.0 ) ) 117 117 .arg( Utils::sizeToString( tor.uploadedEver( ) ) ) 118 118 .arg( Utils::ratioToString( tor.ratio( ) ) ); … … 191 191 { 192 192 case TR_STATUS_CHECK: 193 str = tr( "Verifying local data (%1% tested)" ).arg( tor.getVerifyProgress()*100.0, 0, 'f', 1);193 str = tr( "Verifying local data (%1% tested)" ).arg( Utils::percentToString( tor.getVerifyProgress()*100.0 ) ); 194 194 break; 195 195 … … 232 232 else 233 233 str = tr( "Downloading metadata from %n peer(s) (%1% done)", 0, tor.peersWeAreDownloadingFrom( ) ) 234 .arg( int(100.0 * tor.metadataPercentDone( ) ) );234 .arg( Utils::percentToString( 100.0 * tor.metadataPercentDone( ) ) ); 235 235 break; 236 236 -
trunk/qt/utils.cc
r10818 r10822 48 48 49 49 QString 50 Utils :: sizeToString( double 50 Utils :: sizeToString( double bytes ) 51 51 { 52 52 if( !bytes ) … … 72 72 73 73 QString 74 Utils :: percentToString( double x ) 75 { 76 char buf[128]; 77 return QString( tr_strpercent( buf, x, sizeof(buf) ) ); 78 } 79 80 QString 74 81 Utils :: ratioToString( double ratio ) 75 82 { 76 QString buf; 77 78 if( (int)ratio == TR_RATIO_NA ) 79 buf = tr( "None" ); 80 else if( (int)ratio == TR_RATIO_INF ) 81 buf = QString::fromUtf8( "\xE2\x88\x9E" ); 82 else 83 { 84 QStringList temp; 85 86 temp = QString().sprintf( "%f", ratio ).split( "." ); 87 if( ratio < 100.0 ) 88 { 89 if( ratio < 10.0 ) 90 temp[1].truncate( 2 ); 91 else 92 temp[1].truncate( 1 ); 93 buf = temp.join( "." ); 94 } 95 else 96 buf = QString( temp[0] ); 97 } 98 99 return buf; 100 83 char buf[128]; 84 return QString::fromUtf8( tr_strratio( buf, sizeof(buf), ratio, "\xE2\x88\x9E" ) ); 101 85 } 102 86 -
trunk/qt/utils.h
r10818 r10822 31 31 static QString sizeToString( double bytes ); 32 32 static QString speedToString( const Speed& speed ); 33 static QString percentToString( double x ); 33 34 static QString ratioToString( double ratio ); 34 35 static QString timeToString( int seconds ); -
trunk/web/javascript/common.js
r10812 r10822 117 117 */ 118 118 Math.roundWithPrecision = function(floatnum, precision) { 119 return Math.round ( floatnum * Math.pow ( 10, precision ) ) / Math.pow ( 10, precision ); 120 }; 121 119 return Math.round( floatnum * Math.pow ( 10, precision ) ) / Math.pow( 10, precision ); 120 }; 122 121 123 122 /* 124 123 * Given a numerator and denominator, return a ratio string 125 124 */ 126 Math.ratio = function( numerator, denominator ) 127 { 125 Math.ratio = function( numerator, denominator ) { 128 126 var result = Math.floor(100 * numerator / denominator) / 100; 129 127 130 128 // check for special cases 131 if (isNaN(result)) result = 0; 132 if (result=="Infinity") result = "∞"; 133 134 // Add the decimals if this is an integer 135 if ((result % 1) == 0) 136 result = result + '.00'; 129 if(result==Number.POSITIVE_INFINITY || result==Number.NEGATIVE_INFINITY) result = -2; 130 else if(isNaN(result)) result = -1; 137 131 138 132 return result; 139 133 }; 134 135 /* 136 * Truncate a float to a specified number of decimal 137 * places, stripping trailing zeroes 138 * 139 * @param float floatnum 140 * @param integer precision 141 * @returns float 142 */ 143 Math.truncateWithPrecision = function(floatnum, precision) { 144 return Math.floor( floatnum * Math.pow ( 10, precision ) ) / Math.pow( 10, precision ); 145 }; 146 147 /* 148 * Round a string of a number to a specified number of decimal 149 * places 150 */ 151 Number.prototype.toTruncFixed = function( place ) { 152 var ret = Math.truncateWithPrecision( this, place ); 153 return ret.toFixed( place ); 154 } 140 155 141 156 /* -
trunk/web/javascript/formatter.js
r10812 r10822 18 18 MODE_IEC: 1, 19 19 MODE_SI: 2, 20 21 /* 22 * Format a percentage to a string 23 */ 24 percentString: function( x ) { 25 if( x < 10.0 ) 26 return x.toTruncFixed( 2 ); 27 else if( x < 100.0 ) 28 return x.toTruncFixed( 1 ); 29 else 30 return x.toTruncFixed( 0 ); 31 }, 32 33 /* 34 * Format a ratio to a string 35 */ 36 ratioString: function( x ) { 37 if( x == -1 ) 38 return "None"; 39 else if( x == -2 ) 40 return '∞'; 41 else 42 return this.percentString( x ); 43 }, 20 44 21 45 setMode: function( mode ) { -
trunk/web/javascript/torrent.js
r10812 r10822 247 247 }, 248 248 getPercentDoneStr: function() { 249 return Math.floor(100 * Math.ratio( 100 * ( this._sizeWhenDone - this._leftUntilDone ), 250 this._sizeWhenDone )) / 100; 249 return Transmission.fmt.percentString( 100 * this.getPercentDone() ); 251 250 }, 252 251 size: function() { return this._size; }, … … 493 492 // 'Verifying local data (40% tested)' 494 493 c = 'Verifying local data ('; 495 c += Math.roundWithPrecision( 100.0 * this._recheckProgress, 0);494 c += Transmission.fmt.percentString( 100.0 * this._recheckProgress ); 496 495 c += '% tested)'; 497 496 break; … … 530 529 531 530 if( this.needsMetaData() ){ 532 var metaPercentComplete = this._metadataPercentComplete * 100 0 / 100531 var metaPercentComplete = this._metadataPercentComplete * 100; 533 532 progress_details = "Magnetized transfer - retrieving metadata ("; 534 progress_details += metaPercentComplete;533 progress_details += Transmission.fmt.percentString( metaPercentComplete ); 535 534 progress_details += "%)"; 536 535 … … 544 543 root._progress_incomplete_container.className = 'torrent_progress_bar incomplete compact meta'+compact; 545 544 root._progress_incomplete_container.style.display = 'block'; 546 547 545 } 548 546 else if( notDone ) … … 571 569 572 570 // Figure out the percent completed 573 var css_completed_width = Math.floor( this.getPercentDone() * 100 * MaxBarWidth ) / 100;571 var css_completed_width = ( this.getPercentDone() * MaxBarWidth ).toTruncFixed( 2 ); 574 572 575 573 // Update the 'in progress' bar … … 601 599 602 600 // Create the 'progress details' label 603 // Eg: '698.05 MiB, uploaded 8.59 GiB (Ratio: 12.3)' 604 c = Transmission.fmt.size( this._size ); 601 // Partial seed 602 if( this._size != this._sizeWhenDone ) { 603 // Eg: '127.21 MiB of 698.05 MiB (18.2%)' 604 c = Transmission.fmt.size( this._sizeWhenDone ); 605 c += ' of '; 606 c += Transmission.fmt.size( this._size ); 607 c += ' ('; 608 c += Transmission.fmt.percentString( 100.0 * this._sizeWhenDone / this._size ); 609 c += '%)'; 610 } 611 // Regular seed 612 else { 613 // Eg: '698.05 MiB' 614 c = Transmission.fmt.size( this._size ); 615 } 616 // Eg:', uploaded 8.59 GiB (Ratio: 12.3)' 605 617 c += ', uploaded '; 606 618 c += Transmission.fmt.size( this._upload_total ); 607 619 c += ' (Ratio '; 608 if(this._upload_ratio > -1) 609 c += Math.round(this._upload_ratio*100)/100; 610 else if(this._upload_ratio == -2) 611 c += 'Inf'; 612 else 613 c += '0'; 620 c += Transmission.fmt.ratioString( this._upload_ratio ); 614 621 c += ')'; 615 622 c += eta; … … 962 969 c += Transmission.fmt.size(this._size); 963 970 c += ' ('; 964 c += Math.ratio(100 * this._done, this._size);971 c += this._size ? Transmission.fmt.percentString(100 * this._done / this._size) : '100'; 965 972 c += '%)'; 966 973 setInnerHTML(this._progress[0], c); -
trunk/web/javascript/transmission.js
r10812 r10822 1005 1005 setInnerHTML( $('#stats_session_uploaded')[0], Transmission.fmt.size(session["uploadedBytes"]) ); 1006 1006 setInnerHTML( $('#stats_session_downloaded')[0], Transmission.fmt.size(session["downloadedBytes"]) ); 1007 setInnerHTML( $('#stats_session_ratio')[0], Math.ratio(session["uploadedBytes"],session["downloadedBytes"]));1007 setInnerHTML( $('#stats_session_ratio')[0], Transmission.fmt.ratioString(Math.ratio(session["uploadedBytes"],session["downloadedBytes"]))); 1008 1008 setInnerHTML( $('#stats_session_duration')[0], Transmission.fmt.timeInterval(session["secondsActive"]) ); 1009 1009 setInnerHTML( $('#stats_total_count')[0], total["sessionCount"] + " times" ); 1010 1010 setInnerHTML( $('#stats_total_uploaded')[0], Transmission.fmt.size(total["uploadedBytes"]) ); 1011 1011 setInnerHTML( $('#stats_total_downloaded')[0], Transmission.fmt.size(total["downloadedBytes"]) ); 1012 setInnerHTML( $('#stats_total_ratio')[0], Math.ratio(total["uploadedBytes"],total["downloadedBytes"]));1012 setInnerHTML( $('#stats_total_ratio')[0], Transmission.fmt.ratioString(Math.ratio(total["uploadedBytes"],total["downloadedBytes"]))); 1013 1013 setInnerHTML( $('#stats_total_duration')[0], Transmission.fmt.timeInterval(total["secondsActive"]) ); 1014 1014 }, … … 1268 1268 setInnerHTML( tab.uploaded, torrents.length ? Transmission.fmt.size( total_upload ) : na ); 1269 1269 setInnerHTML( tab.downloaded, torrents.length ? Transmission.fmt.size( total_download ) : na ); 1270 setInnerHTML( tab.availability, torrents.length ? Math.ratio( total_availability*100, sizeWhenDone) + '%' : na );1271 setInnerHTML( tab.ratio, torrents.length ? Math.ratio( total_upload, total_download) : na );1270 setInnerHTML( tab.availability, torrents.length ? Transmission.fmt.percentString(Math.ratio( total_availability*100, sizeWhenDone )) + '%' : na ); 1271 setInnerHTML( tab.ratio, torrents.length ? Transmission.fmt.ratioString(Math.ratio( total_upload, total_download )) : na ); 1272 1272 setInnerHTML( tab.have, torrents.length ? Transmission.fmt.size(total_completed) + ' (' + Transmission.fmt.size(total_verified) + ' verified)' : na ); 1273 1273 setInnerHTML( tab.upload_to, torrents.length ? total_upload_peers : na ); … … 1275 1275 setInnerHTML( tab.secure, private_string ); 1276 1276 setInnerHTML( tab.creator_date, date_created ); 1277 setInnerHTML( tab.progress, torrents.length ? Math.ratio( sizeDone*100, sizeWhenDone) + '%' : na );1277 setInnerHTML( tab.progress, torrents.length ? Transmission.fmt.percentString(Math.ratio( sizeDone*100, sizeWhenDone )) + '%' : na ); 1278 1278 setInnerHTML( tab.comment, comment == na ? comment : comment.replace(/\//g, '/​') ); 1279 1279 setInnerHTML( tab.creator, creator );
Note: See TracChangeset
for help on using the changeset viewer.