From d6ab70447e318e8b558aff51919ee2a70c4d5290 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Mon, 21 Mar 2016 14:35:58 -0700 Subject: [PATCH] [Data Format] Don't truncate data values --- platform/telemetry/src/TelemetryFormatter.js | 6 +----- platform/telemetry/test/TelemetryFormatterSpec.js | 5 ++++- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/platform/telemetry/src/TelemetryFormatter.js b/platform/telemetry/src/TelemetryFormatter.js index dd434d4ac3..3a68a38728 100644 --- a/platform/telemetry/src/TelemetryFormatter.js +++ b/platform/telemetry/src/TelemetryFormatter.js @@ -26,10 +26,6 @@ define( function () { "use strict"; - // Date format to use for domain values; in particular, - // use day-of-year instead of month/day - var VALUE_FORMAT_DIGITS = 3; - /** * The TelemetryFormatter is responsible for formatting (as text * for display) values along either the domain (usually time) or @@ -73,7 +69,7 @@ define( * value, suitable for display. */ TelemetryFormatter.prototype.formatRangeValue = function (v, key) { - return isNaN(v) ? String(v) : v.toFixed(VALUE_FORMAT_DIGITS); + return String(v); }; return TelemetryFormatter; diff --git a/platform/telemetry/test/TelemetryFormatterSpec.js b/platform/telemetry/test/TelemetryFormatterSpec.js index 23c7b95fd4..65cd363aa6 100644 --- a/platform/telemetry/test/TelemetryFormatterSpec.js +++ b/platform/telemetry/test/TelemetryFormatterSpec.js @@ -59,7 +59,10 @@ define( }); it("formats ranges as values", function () { - expect(formatter.formatRangeValue(10)).toEqual("10.000"); + var value = 3.14159265352979323846264338, // not pi + formatted = formatter.formatRangeValue(value); + // Make sure we don't lose information by formatting + expect(parseFloat(formatted)).toEqual(value); }); }); }