Fixed number formating issue when InfluxDB return MAX float64, Fixes #1402

This commit is contained in:
Torkel Ödegaard 2015-02-22 07:44:40 +01:00
parent 8c977e37a9
commit 31e5271921
2 changed files with 5 additions and 0 deletions

View File

@ -326,11 +326,15 @@ function($, _, moment) {
}
var steps = 0;
var limit = extArray.length;
while (Math.abs(size) >= factor) {
steps++;
size /= factor;
if (steps >= limit) { return "NA"; }
}
if (steps > 0) {
decimals = scaledDecimals + (3 * steps);
}

View File

@ -25,6 +25,7 @@ define([
describeValueFormat('none', 2.75e-10, 0, 10, '3e-10');
describeValueFormat('none', 0, 0, 2, '0');
describeValueFormat('bytes', -1.57e+308, -1.57e+308, 2, 'NA');
describeValueFormat('ns', 25, 1, 0, '25 ns');
describeValueFormat('ns', 2558, 50, 0, '2.56 µs');