Skip to content

Commit

Permalink
This fixes #692. If ratePerSecond is NaN, set errorThenVolume to -1
Browse files Browse the repository at this point in the history
  • Loading branch information
Nils Larsgård committed Feb 23, 2015
1 parent ac98646 commit 078bf14
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,7 @@
var ratePerSecond = data.ratePerSecond;
var ratePerSecondPerHost = data.ratePerSecondPerHost;
var ratePerSecondPerHostDisplay = ratePerSecondPerHost;
var errorThenVolume = (data.errorPercentage * 100000000) + ratePerSecond;

var errorThenVolume = isNan( ratePerSecond )? -1: (data.errorPercentage * 100000000) + ratePerSecond;
// set the rates on the div element so it's available for sorting
$('#CIRCUIT_' + data.escapedName).attr('rate_value', ratePerSecond);
$('#CIRCUIT_' + data.escapedName).attr('error_then_volume', errorThenVolume);
Expand Down

2 comments on commit 078bf14

@wblakecaldwell
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be "isNaN" instead of "isNan". I'll submit a pull request shortly.

@ninhc1010l
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ratePerSecond host and ratePerSecond cluster still display NaN.0/s. May be cause by roundNumber function. Please check.

Please sign in to comment.