Changeset 8280


Ignore:
Timestamp:
Apr 24, 2009, 3:21:15 AM (13 years ago)
Author:
Gimp
Message:

Hopefully put an end to all these percentage bugs in the web client

Location:
trunk/web/javascript
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/web/javascript/common.js

    r8062 r8280  
    207207Math.ratio = function( numerator, denominator )
    208208{
    209         var result = Math.roundWithPrecision((numerator / denominator), 2);
     209        var result = Math.floor(100 * numerator / denominator) / 100;
    210210
    211211        // check for special cases
  • trunk/web/javascript/torrent.js

    r8273 r8280  
    159159        },
    160160        getPercentDoneStr: function() {
    161                 return Math.ratio( 10000 * ( this._sizeWhenDone - this._leftUntilDone ),
    162                                              this._sizeWhenDone ) / 100.0;
     161                return Math.floor(100 * Math.ratio( 100 * ( this._sizeWhenDone - this._leftUntilDone ),
     162                                           this._sizeWhenDone )) / 100;
    163163        },
    164164        size: function() { return this._size; },
Note: See TracChangeset for help on using the changeset viewer.