[Plot] Normalize number of digits

Use consistent number of digits for displayed plot values, to avoid
unreadable plot legends due to fix for #778
This commit is contained in:
Victor Woeltjen
2016-03-21 14:39:17 -07:00
parent d6ab70447e
commit 5f6b4adcda
2 changed files with 12 additions and 3 deletions

View File

@ -55,14 +55,17 @@ define(
.toHaveBeenCalledWith(12321, domainFormat);
});
it("includes format in formatRangeValue calls", function () {
it("includes format in formatRangeValue calls for strings", function () {
mockFormatter.formatRangeValue.andReturn("formatted!");
expect(formatter.formatRangeValue(12321))
expect(formatter.formatRangeValue('foo'))
.toEqual("formatted!");
expect(mockFormatter.formatRangeValue)
.toHaveBeenCalledWith(12321, rangeFormat);
.toHaveBeenCalledWith('foo', rangeFormat);
});
it("formats numeric values with three fixed digits", function () {
expect(formatter.formatRangeValue(10)).toEqual("10.000");
});
});
});