Fixed rounding issues where raw value was added instead of rounded, fixes #815

This commit is contained in:
Gion Kunz 2016-10-23 21:29:46 +02:00
parent 1b32910002
commit 1f677569eb
2 changed files with 2 additions and 2 deletions

View File

@ -800,7 +800,7 @@ var Chartist = {
for (i = bounds.min; i <= bounds.max; i = safeIncrement(i, bounds.step)) {
var value = Chartist.roundWithPrecision(i);
if (value !== values[values.length - 1]) {
values.push(i);
values.push(value);
}
}
bounds.values = values;

View File

@ -421,7 +421,7 @@ describe('Chartist core', function() {
expect(bounds.max).toBe(1000);
expect(bounds.low).toBe(999.9999999999997);
expect(bounds.high).toBe(1000.0000000000001);
expect(bounds.values).toEqual([999.9999999999999]);
expect(bounds.values).toEqual([Chartist.roundWithPrecision(999.9999999999999)]);
});
});